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 byDecision
element in the case of lightning record-triggered flow. Take a look at the sample record-triggered flow screenshot below:On the record-triggered flow, you can define multiple
Scheduled paths
(in each path, you will define when it needs to execute viaTime Source
,Offset Option
&Offset Value
) and then define theDecision
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 theDecision
element, you can also define multipleoutcomes
(which can be further condition based) or after theDecision
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 fewDecision
elements and conditionally perform immediate actions. Also, in the delayedScheduled path
(for example, Run after 1 day in the above image), theDecision
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 theDecision
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 thescheduled path
execute under system context.One point worth assessing before jumping into creating the lightning flow, esp. w.r.t your following point:
"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 usingDecision
/ outcomes & other flow elements.