Before-save versus after-save record-triggered flows
Key Takeaway
Use a before-save flow when all you need is to update or validate the record that triggered the flow. Use an after-save flow for anything beyond that, such as work that needs the new record's ID.
A record-triggered flow runs automatically when someone creates, updates, or deletes a record. A before-save flow runs before Salesforce saves the record, so it can quickly change or validate that same record. An after-save flow runs after the save, when the record has an ID, so it can also work with other records, send emails, and call external systems.
What each flow can do
You configure the record trigger in the Start element of a record-triggered flow.
| Before-save flow | After-save flow | |
|---|---|---|
| Records | Can only update and validate the triggering record. Cannot create or update related records. | Can create and update any record. |
| Elements | Supports only four: Assignment, Decision, Get Records, and Loop. | Can use every element, such as Create Records, Update Records, Send Email, and subflows. |
| Cannot send email. | Can send emails and outbound messages. | |
| External systems | Cannot call external systems. | Can call external systems or APIs. |
A before-save flow can still use a Get Records element to read data from other records. The flow can then use that data to decide how to set the triggering record's fields.
Only a before-save flow can stop bad data. It can show an error message and block the save before the data is committed. An after-save flow cannot block the save because the record is already saved when it runs.
For example, say you want to set an opportunity's Priority to High when its Amount is over $50,000. A before-save flow fits this job because it only changes the triggering record. Now say you want to create a Task for a manager when a case is created with Priority set to Critical. You need an after-save flow here because the job creates a related record.