1

If I have a Record-triggered after-save Flow with Scheduled Paths, will those scheduled items be removed from the schedule if the Flow's version changes with altered entry criteria?

This question was triggered by an investigation about Process Builder Scheduled Action behavior after a version change as seen in these questions:

Best stated in this Community post and this post

After speaking with Salesforce support we determined that it was process versioning that was causing the problem. For instance, if a case had scheduled actions and I activated a new process and then unmet the criteria, the scheduled actions operating off of the old version of the process do not recognize the new criteria and continue to fire the actions until the end of that criteria node.

Since Flow is the replacement for Process Builder, are Scheduled Paths afflicted with the same Process Builder versioning issue?

2

The short answer is NO; the new flow version's entry criteria gets applied to pending scheduled paths generated by prior flow versions

I did an experiment:

  • Create a Flow Version 1 with entry condition: Is_FieldA__c = TRUE and two actions to send emails at +7 and +14 days
  • Created an object with name = MyRecord that met entry conditions

RESULT:

Setup | Time-based Workflow shows 2 pending entries for +7 and +14 days for record MyRecord

I then updated the Flow to Version 2 and added an additional entry condition such that the emails get scheduled when

  • Is_FieldA__c = TRUE AND Is_FieldB__c = TRUE

Upon updating MyRecord such that FieldA was TRUE but FieldB was FALSE...

RESULT:

Setup | Time-based Workflow shows 0 pending entries for record MyRecord

That is, changing the flow version and amending the entry conditions in the new version will apply to records that scheduled elements under prior versions - thus enabling one to introduce new criteria over time to remove in-flight scheduled actions and not needing to resort to the complexities associated with Process Builder.

Side bar

I surmise this works because Scheduled Paths on record-triggered flows come directly out of the flow's entry conditions. In Process Builder, you can have many decision criteria nodes, some of which are attached to Scheduled Actions. Thus, when the Process Builder changes versions, SFDC essentially assumes the entire old Process Builder is effectively NOP and the only thing Salesforce will do is accelerate/defer the scheduled events of the old version if the underlying reference date changes.

What Happens When the Associated Process Is Deactivated?

After you deactivate a process, the scheduled time for pending scheduled actions stays the same. If a deactivated process has pending scheduled actions and the record whose field the schedule is based on is changed, Salesforce recalculates the schedule for those actions. After a process is deactivated, Salesforce ignores all other changes to the associated records."

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.