Source: Triggers and Order of Execution (Apex Developer Guide, Spring '26). The list applies to inserts, updates and upserts through the UI, API, Apex and Flow.
Loads the original record from the database (or initialises it for an insert).
Runs system validation for standard UI edit pages only (required fields, field formats, layout-specific rules). API/Apex saves skip this step.
Executes record-triggered flows configured to run before the record is saved.
Executes all before triggers.
Runs most system validation again plus custom validation rules (and, for a UI save, layout rules).
Executes duplicate rules; a Block action ends the save here.
Saves the record to the database but does not commit.
Executes all after triggers.
Executes assignment rules.
Executes auto-response rules.
Executes workflow rules; if a field update happens, the record is updated again and before/after triggers fire one more time (only once more).
Executes escalation rules.
Executes flow automations launched by processes or workflow rules (not before-save flows).
Executes record-triggered flows configured to run after the record is saved. Flows on API version 54.0 or later were moved earlier in Spring '22 so that their updates are visible to workflow rules and entitlement rules — see the note on the source page and the Spring '22 release note for the exact position of your flow's API version.
Executes entitlement rules.
Recalculates roll-up summary fields on the parent and saves the parent (parent goes through its own save procedure).
Same-record field defaults belong in step 3 (before-save flow) or step 4 (before trigger): no extra DML, no re-fire.
Validation rules (step 5) run after before triggers/flows, so they see defaulted values.
A workflow field update (step 11) re-runs your triggers: guard with the processed-Id set or retire workflow rules.
Nothing before step 19 is durable: an exception anywhere rolls the whole transaction back, including Platform Events published with Publish Immediately (those are not rolled back — use Publish After Commit).
Roll-up summary recalculation (16–17) means a child save can lock and re-save its parent: watch lookup skew and UNABLE_TO_LOCK_ROW under parallel loads.
# Order of execution (save of one record)
Source: [Triggers and Order of Execution](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_triggers_order_of_execution.htm) (Apex Developer Guide, Spring '26). The list applies to inserts, updates and upserts through the UI, API, Apex and Flow.
1. Loads the original record from the database (or initialises it for an insert).
2. Runs system validation for standard UI edit pages only (required fields, field formats, layout-specific rules). API/Apex saves skip this step.
3. Executes **record-triggered flows configured to run before the record is saved**.
4. Executes all **before triggers**.
5. Runs most system validation again plus **custom validation rules** (and, for a UI save, layout rules).
6. Executes **duplicate rules**; a Block action ends the save here.
7. Saves the record to the database but does **not commit**.
8. Executes all **after triggers**.
9. Executes **assignment rules**.
10. Executes **auto-response rules**.
11. Executes **workflow rules**; if a field update happens, the record is updated again and before/after triggers fire **one more time** (only once more).
12. Executes **escalation rules**.
13. Executes flow automations launched by processes or workflow rules (not before-save flows).
14. Executes **record-triggered flows configured to run after the record is saved**. Flows on API version 54.0 or later were moved earlier in Spring '22 so that their updates are visible to workflow rules and entitlement rules — see the note on the source page and the [Spring '22 release note](https://help.salesforce.com/s/articleView?id=release-notes.rn_automate_flow_builder_trigger_order.htm&language=en_US&release=236&type=5) for the exact position of your flow's API version.
15. Executes **entitlement rules**.
16. Recalculates **roll-up summary fields** on the parent and saves the parent (parent goes through its own save procedure).
17. Recalculates grandparent roll-up summaries.
18. Runs **criteria-based sharing evaluation**.
19. **Commits** all DML operations to the database.
20. Executes **post-commit logic**: sends email, enqueues async Apex (Queueable, Batch, future), delivers Platform Events with *Publish After Commit*, runs asynchronous flow paths.
## Consequences for design
- Same-record field defaults belong in step 3 (before-save flow) or step 4 (before trigger): no extra DML, no re-fire.
- Validation rules (step 5) run *after* before triggers/flows, so they see defaulted values.
- A workflow field update (step 11) re-runs your triggers: guard with the processed-Id set or retire workflow rules.
- Nothing before step 19 is durable: an exception anywhere rolls the whole transaction back, including Platform Events published with *Publish Immediately* (those are not rolled back — use *Publish After Commit*).
- Roll-up summary recalculation (16–17) means a child save can lock and re-save its parent: watch lookup skew and `UNABLE_TO_LOCK_ROW` under parallel loads.