Platform
Before-save vs after-save Flow: choose the right context
Use before-save Flow for same-record field updates and after-save Flow for related work. Understand after-commit behavior, recursion and useful release tests.
Updating the record that started your Flow does not always need another save. Use a before-save record-triggered Flow when the task is to set fields on that same record.
Use an after-save context when the work needs capabilities such as updating related records or invoking an action. Then decide whether that work belongs in the original transaction or after it commits. “After save” does not mean every part of the transaction has already committed.
Salesforce’s record-triggered automation decision guide explains these context and capability differences. Treat the choice as part of the transaction design, not simply a preference between two Flow Builder options.
Match the work to the context
| Intended work | Starting choice | Check before implementation |
|---|---|---|
| Set a field on the triggering record | Before-save Flow | The calculation uses data available in that context |
| Create or update related records | After-save Flow | The related write is needed and its failure behavior is defined |
| Invoke Apex from a record-triggered Flow | Supported after-save action context | Inputs, bulk behavior and transaction limits |
| Perform work after the original transaction commits | Supported asynchronous path or another async design | Delivery, retries and visibility of failure |
For a same-record field update, assign the value to the triggering record in the supported before-save path. Avoid an unnecessary second update of that record. A second save can run more automation and create recursion that the original requirement did not need.
For related work, define what should happen if the related record cannot be written. Sometimes the original save should fail with it; sometimes the business wants the save to succeed and the follow-up to be handled separately. Make that decision with the workflow owner.
Keep entry conditions tied to the change
A Flow that runs on every update can repeat work after an unrelated edit. Compare the relevant current and prior field values where the requirement is a transition, such as a status moving to an approved state.
Write the condition in business terms first. For example: create one follow-up when a request first becomes eligible. Then determine whether later edits should update that follow-up, leave it alone or create a new one. “Run whenever eligible” is a different rule.
Inspect other automation on the object before adding a new path. A Flow can trigger a related update that causes another Flow or trigger to run. A diagram of those writes often explains a recursion issue faster than adding another condition without understanding the cycle.
Treat asynchronous work as a separate outcome
An asynchronous path runs after the original transaction commits, according to the supported path’s behavior. Its eventual completion is not proved by the user’s successful save. Record failures where an owner can find them and define whether the work may be retried.
For an external write, decide how a repeated request is identified. A timeout can leave the remote outcome uncertain. The agent action failure guide covers the same reconciliation problem when an agent triggers the operation.
Test changes and batches, not only one create
Use representative records to test a create, the intended field transition, an unrelated edit and a repeated update. Include multiple records in one transaction and a related-record failure. Confirm both the final values and the number of follow-up records created.
Write down the expected transaction outcome for each case before running it. If a related update fails, the test should establish whether the original save rolls back or succeeds with follow-up work pending. This article proposes those checks; it does not claim they were run in your org.
Keep the simplest context that meets the requirement. When the task is just setting a field on the same record, the extra write and recovery path of an after-save design need a reason.