1

I have had searching the way to build with flows an user requirement that was built with the process builder but I have not been able to migrate it. I notice that the difference between scheduled paths (in flows) and scheduled actions (in processes) is that the scheduled actions can be executed, for example, after a series of conditions created on differents decision logic components but in Flows all scheduled paths born from the root. My requirement is:

if conditionA then
      schedule an action 24 hrs after X date to do action Z
else if condictionB then
      schedule an action 48 hrs after Y date to do action W

Instead in Flows I can do this:

schedule an action 24 hrs after X date then
     if conditionA then
          do action Z
schedule an action 48 hrs after Y date then
     if conditionB then
          do action W    

Apparently Flows do not have the possibility to create the "else if" conditions like processes? Could you please help me with that?

Thanks!

3 Answers 3

2

You have your logic backwards. Start with a Decision node, add your Conditions, then for each branch, you can specify Pauses. Note that you need an Autolaunched Flow for Pause elements, but you should be able to call this flow from a standard Process Builder or Record-Triggered Flow.

Here's what that might look like:

Autolaunched Flow

Which you can then call from the main flow:

Record-Triggered Flow

Note that the Decision element evaluates in order from left to right, and will only take the first path that meets the criteria.

2
  • Thanks @sfdcfox!, I will test this approach. Question: Do you know if the process is cancelled if while the transaction is paused, the record does not meet the criteria like an time-based workflow would do?. I don't know if I am right but, with this approach, the action would execute although after the pause the record does not meet the criteria.
    – FarKorE
    Commented Apr 3, 2022 at 17:32
  • @FarKorE As far as I'm aware, the scheduled action isn't canceled in this case. It's also unclear if Scheduled Paths are canceled if the criteria is no longer met. You might want to include additional decisions if you go this route.
    – sfdcfox
    Commented Apr 3, 2022 at 17:45
1

Use entry criteria with separate Record Triggered Flows and Scheduled Paths!

Record Triggered Flow 1
 Entry Criteria: Condition A
  Scheduled Path 24 hours after X Date
   Action Z

Record Triggered Flow 2
 Entry Criteria: Condition B and not Condition A
  Scheduled Path 48 hours after Y Date
   Action W
0

Unfortunately, separate record triggered flows with criteria and scheduled paths seems like the only option at this point. It's not possible to have Pause elements in a record triggered flow or even in an autolaunched flow referenced as a subflow in a record triggered flow.

This is a big shortcoming right now - vote for this idea: https://ideas.salesforce.com/s/idea/a0B8W00000H4wzKUAR/allow-recordtriggered-flows-to-call-subflows-with-pause-elements

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .