What Happens To "Inflight" Process Builders When You Activate a new Version?

tl;dr : If an individual record is in a "Paused Flow Interview" state, and you create a new version of the Process Builder, the record will "wake up" at its specified time and complete the actions as specified in the version of the PB that was active when the record entered the paused state.


There is some confusion as to what happens to Process Builders that have "inflight" time-based actions when you create a new version of the PB. 


The information from Salesforce is incomplete and there are contradictory StackExchange answers, including here. At the time of writing, the first answer answers the wrong question, and the 2nd and 3rd answers fully contradict each other. Clearly this is due for someone to just test it.

My Test

I conducted the following test - I'm going to create a PB, create a test record, and see what happens if I update the PB while the record is pending. One of three things is going to happen:

  1. Nothing will happen to the record
  2. The record will be updated according to the original version of the PB that it was invoked against
  3. The record will be updated according to the updated version of the PB that is active at the "wake-up time"

Using a Utility Object in my Summer '20 sandbox, I created a PB:



This PB will simply fire when a Utility Object is created (with a test flag), wait an hour, and then update the record with a value.


I then created a Utility Object that met my criteria. I got the following in Setup > Paused Flow Interviews:


While that record was in waiting state, I updated the PB.

 1. Clone the PB
 2. Update the PB to write a different value in the field
 3. Activate the PB

The PB now has Version 2 active, and Version 1 is inactive.



Results

The original Paused Flow Interview was not changed. It remained tied to Version 1 of the PB. Note: the "Current Flow Version" column still read 1, although I would have expected it to read 2 since 2 is current. So this column seems untrustworthy.

At the one hour mark, the Paused Flow Interview disappeared from the queue. And the record?


The record was updated according to the original version of the flow that was active when the timer started.



Comments

Popular posts from this blog

Setting a DateTime to a Weekday in a Formula

"Disjunctions not supported" - Why Custom Metadata and Flow Don't Mix

Update Knowledge Articles in Bulk