Sub topic 3
Entry Conditions and Run Frequency
This chapter covers how a record-triggered flow decides whether to run for a given record. It assumes you know the Salesforce data model, can use Flow Builder, and can write basic formulas with Boolean logic. The previous chapter covered choosing the object and trigger event. Here you narrow when the flow starts.
Why entry conditions matter
Without entry conditions, a flow starts for every record that matches the trigger event. Every Opportunity save would start the flow, even when your logic applies to a small share of them. Entry conditions filter records before the flow starts. Filtered-out records never start an interview, so they use none of the flow's resources.
Putting the filter in the entry conditions is better than putting a Decision element first. A Decision runs inside a flow that has already started. Entry conditions stop the flow from starting at all.
Three ways to set the condition
Flow Builder offers three requirement modes in the Start element.
| Mode | What you provide | Use it when |
|---|---|---|
| None | Nothing | Every record should run the flow |
| Conditions Are Met | Field, operator, and value rows | The rule compares fields to fixed values |
| Formula Evaluates to True | One Boolean formula | You need functions, several fields, or change detection |
For the condition rows, you choose how they combine: All Conditions Are Met (AND), Any Condition Is Met (OR), or Custom Condition Logic such as 1 AND (2 OR 3).
Detecting a change with a formula
Condition rows compare a field to a value. They cannot ask whether a field has just changed. For that, use a formula entry condition. The formula below lets an Opportunity update enter the flow only when its stage has just changed to Closed Won.
AND(
ISCHANGED({!$Record.StageName}),
{!$Record.StageName} = "Closed Won"
)ISCHANGED compares the current value in $Record with the prior value. The next chapter covers $Record and $Record__Prior in detail.
Run frequency
A record can be saved many times. The run frequency setting controls what happens when it is saved again. It applies only when the trigger is "A record is created or updated" and you used conditions.
- Only when a record is updated to meet the condition requirements. The flow runs when the record changes from not meeting the conditions to meeting them. A later save that still meets them does not run it again. This is the default and usually the right choice.
- Every time a record is updated and meets the condition requirements. The flow runs on every save that meets the conditions.
Take the condition Amount > 100000. An Opportunity goes from 50,000 to 150,000, so the flow runs. If someone then edits the Description with the amount still at 150,000, the "only when" option does not run the flow again. The "every time" option does. If the amount drops to 80,000 and later rises above 100,000, the record has newly met the condition, so both options run the flow.
The "every time" option can cause repeated work. It also raises the risk of recursion, because a flow that updates its own record can trigger itself again. Recursion is covered in a later chapter.
How the two settings combine
Common errors
- Using a Decision as the only filter, so the flow starts for every record.
- Choosing "every time" and then creating a new related record on each save.
- Writing a formula that references a field with
$Record__Prioron a create-only flow, where no prior record exists. - Expecting the condition to be checked after the flow's own changes. Entry conditions are checked against the record as saved when the flow is triggered.
Exercise
An Opportunity flow has the entry condition {!$Record.Amount} > 100000 and the run frequency "Only when a record is updated to meet the condition requirements". An Opportunity's amount is 150,000 and a user edits only its Description. Does the flow run? What changes if the setting is "Every time a record is updated and meets the condition requirements"?
Show answer
With "only when", the flow does not run. The record already met the condition before the save, so it did not newly meet it. With "every time", the flow runs, because the record meets the condition on this save.
Exercise
Why is a formula entry condition needed to start a flow only when StageName changes to Closed Won?
Show answer
Condition rows compare a field to a value and cannot detect a change. A formula using ISCHANGED({!$Record.StageName}) together with a check for "Closed Won" can.