Salesforce Flow – Multiple Scheduled Paths with Different Pre-conditions

process-buildersalesforce-flowvisual-workflow

I am tasked to migrate an existing Process Builder which has several scheduled actions in it with different conditions/criteria (i.e. scheduled actions on different decision nodes).

How would I achieve the same with just one flow? It has to be just one flow because:

  • There are actions (i.e. set field value, update fields) that need to be executed first before a schedule path can be set
  • So we can ensure that different conditions are evaluated on the order the business prefers
  • We have a 1:1 object-flow policy

Thank you and have a good day!

Best Answer

Unlike process builders where the criteria is defined first followed by scheduled actions, you will have define Scheduled path first followed by Decision element in the case of lightning record-triggered flow. Take a look at the sample record-triggered flow screenshot below:
enter image description here

On the record-triggered flow, you can define multiple Scheduled paths (in each path, you will define when it needs to execute via Time Source, Offset Option & Offset Value) and then define the Decision element for evaluating the conditions that would allow the scheduled path to continue (basically the criteria defined in your process builder + any additional condition). Within the Decision element, you can also define multiple outcomes (which can be further condition based) or after the Decision element, add more flow elements for further processing.

The conversion of the process builder with scheduled actions into a lightning record-triggered flow may not be a simple straight-forward conversion because under few process builder criteria, you might have both immediate actions & scheduled actions. So in such case, under the immediate Scheduled path, you might want add few Decision elements and conditionally perform immediate actions. Also, in the delayed Scheduled path (for example, Run after 1 day in the above image), the Decision element might not be exactly same the process builder criteria because you are conditionally performing both immediate and scheduled paths. And, that would require additional conditions to be defined in the Decision element. There could be few corner case that are quite tricky to achieve via this approach.

Your existing process builder and the business requirements will eventually determine how to define the scheduled path & decision elements in the lightning flow. Note that the scheduled path execute under system context.

One point worth assessing before jumping into creating the lightning flow, esp. w.r.t your following point:

There are actions (i.e. set field value, update fields) that need to be executed first before a schedule path can be set

"Was the existing scheduled actions in process builder really thought thru and needed? Or do you just need to execute action based on updates/ decision outcomes?". If the answer to the first question is NO and the answer to the second one is YES, you can avoid using Scheduled path and design your flow using Decision/ outcomes & other flow elements.

Related Topic