Trigger a Flow to Run After a Record Is Saved
Where: This change applies to Lightning Experience and Salesforce Classic in Essentials, Professional, Enterprise, Performance, Unlimited, and Developer editions.
Who: To activate a record-triggered flow that runs after the record is saved, you need the View All Data permission.
- You can choose to trigger the flow to run only when records are updated. This option isn’t available for record-change processes.
- Unlike processes built in Process Builder, flows have a standard list view, so you can organize and adjust your view to your liking.
- You can access other objects’ records and execute loops.
If you’re familiar with Apex triggers, an after-save record-triggered flow is similar to an Apex after trigger. In a save procedure, after-save record-triggered flows are executed after entitlement rules and before roll-up summary field updates.
How: When creating a flow, select Record-Triggered Flow.
By default, new record-triggered flows are configured to run when a record is created and after the record is saved. You can check this configuration on the Start element in the canvas. Also from the Start element, choose the object whose records trigger the flow to run.
To trigger the flow to run when a record is updated, click Edit on the Start element.
In an after-save record-triggered flow, the $Record global variable contains the Salesforce record that launches the flow. You can update that record by using an Assignment element to set the fields on the $Record global variable. However, unlike before-save record-triggered flows, an Update Records element is required to save those changes to the database.
Configure the Update Records element to use the ID and all field values from the $Record global variable. But be sure to enable Filter inaccessible fields from flow requests in your org’s process automation settings. Otherwise, the flow fails because the Update Records element tries to set the values for system fields and other read-only fields.