Asynchronous Flow Path in Salesforce – Detailed Explanation

visual-workflow

I am having a weird experience with Aysnchronous Path inflow. What if in case if I have to send 10 different emails with different email templates on different conditions.

For example, if Field1 is changed then I need to send Email1, if field 2 changes send email 2. Is that possible with Asynchronous path, because Asynchronous Decisions cannot have is Changed or prior values.

What is the recommended approach? I hate creating multiple flows for each condition set. In process builder, we had different Nodes where you can have a node for each condition set.

I tried this approach by checking all possible conditions in STart conditions, then I tried to handle individual conditions in different outcomes in the Decision, but even if I change Finance Flagged Record = False, the Start Date Changed outcome is getting executed, not sure why? I am guessing because the Prior value in the Asynchronous path will be null. How to Achieve this? I need to combine both email alerts in one flow.

enter image description here

enter image description here

Best Answer

You should be ok with the synchronous path of the flow, the emails will be sent when the transaction has completed, as per the docs.

At run time, the email isn’t sent until the interview’s transaction is completed. Transactions are complete when the interview either finishes or executes a Screen, Local Action, or Pause element.

Also you can use a single decision element to evaluate different scenarios. If the condition seems not to be working I would advise you to debug the flow, through the "Debug" button.

Related Topic