Visual Workflow – Best Practices for Using ‘IS CHANGED’ Operator vs. ‘When to Execute Outcome’ Setting

bestpracticeorder-of-executionrecordtriggeredflowvisual-workflow

Flow decision elements have multiple ways to control when to run a particular path. I frequently have requirements which look like "when this application step is completed, move the Application to the next step". Now from what I can see, there are 2 different ways to do this.

Option 1: Use logic in the Decision Outcome like "Field__c IS CHANGED = TRUE"

Option 2: Update the "When to Execute Outcome" setting to "Only if the record that triggered the flow to run is updated to meet the condition requirements".

enter image description here

These 2 options do the same thing as far as I can tell, so is there a best practice about when to use the IS CHANGED operator vs. the "When to Execute Outcome" setting? Is one more stable/reliable/efficient than the other? Or are they completely interchangeable?

I've noticed that when using the IS CHANGED operator, Flow does not always run as predictably/reliably as I would like, especially if an external system/integration is updating the record. In some scenarios, maybe due to apex firing first and updating other fields, if an external system updates the record it sometimes doesn't see the field in question as having been "changed".

Best Answer

In your specific case, considering only the one field's value, there is essentially no difference.

However, there are differences between the two options if your condition includes multiple different fields (or where the condition doesn't (only) use record field values in the condition terms).

Consider a condition with fields A and B. If you want the logic:

IF B has changed to 1 AND A is 2 THEN

it makes sense to use ISCHANGED against B. Using the "if updated to meet condition" approach and without an ISCHANGED effectively results in:

IF B or A has changed AND B is 1 AND A is 2

Why? Because "if updated to meet condition" can be thought of as: 1. a check of the condition with the old data for the record, then if that is false, 2. a check of the condition with the new record data. At the end of 2, if the condition is met with the new data, we know the record was updated to meet the condition (because it didn't meet before).

If the condition is using non-record data (e.g. variables in the flow returned from invocable apex or similar) then clearly you cannot use ISCHANGED against such a value, and the "if updated to meet condition" option cannot consider a change in that value. However, you can still use the ISCHANGED or "if update to meet condition" approaches on any fields that are used as part of the condition, I believe.