# Order of execution across flows and triggers

*Platform Developer II Study Guide · Process Automation, Logic, and Integration · Last updated October 16, 2026 · https://www.certifyforce.com/study-guide/platform-developer-ii/process-automation-logic-and-integration/order-of-execution-across-flows-and-triggers*

Where before-save flows, Apex triggers, validation rules, assignment rules, after-save flows, roll-ups and post-commit work interleave in one save, why Trigger Order can't reorder Apex, and how one automation's DML re-fires another.

- Certification: Salesforce Platform Developer II
- Exam section: Process Automation, Logic, and Integration
- Study guide: https://www.certifyforce.com/study-guide/platform-developer-ii

**Official exam objective:**

> Given a scenario, identify the considerations of interactions between multiple processes, both declarative and programmatic.

## What the exam expects

- Predict what a before trigger, validation rule or after trigger sees when before-save flows, triggers and assignment rules all act on one save.
- Explain why two Apex triggers on the same object and event run in no guaranteed order, and what Trigger Order in Flow Trigger Explorer can and can't sequence.
- Diagnose re-entry: an after-save flow or trigger whose DML sends the record back through the save, and gate the logic so it doesn't run twice.
- Recognise roll-up cascades, and which post-commit work is lost on rollback.

Key terms: **save order of execution** (the fixed server-side sequence for insert, update and upsert); **before-save flow** (optimized for Fast Field Updates); **after-save flow** (optimized for Actions and Related Records); **Trigger Order** (a 1-2,000 value sequencing record-triggered flows of the same type); **recursive save** (a record re-entering the save through DML in the same transaction); **post-commit logic** (work that starts only after the commit).

## Key facts

| Fact | Detail | Source |
|---|---|---|
| Before-save flows vs before triggers | Before-save flows run immediately before Apex before triggers | [Before-Save Flows](https://help.salesforce.com/s/articleView?id=platform.flow_concepts_trigger_record.htm&type=5) |
| Custom validation rules | Run after before triggers, so they check values the triggers set | [Order of Execution](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_triggers_order_of_execution.htm) |
| Assignment rules | Run after all after triggers (step 9 follows step 8) | [Order of Execution](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_triggers_order_of_execution.htm) |
| Several triggers, same object and event | Firing order isn't guaranteed | [Order of Execution](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_triggers_order_of_execution.htm) |
| Trigger Order range | 1 to 2,000; same trigger type on the same object only | [Flow Run Order](https://help.salesforce.com/s/articleView?language=en_US&id=platform.flow_task_trigger_run_order.htm&type=5) |
| Trigger Order bands | 1-1,000 ascending, then unvalued flows by activation date, then 1,001-2,000 | [Flow Run Order](https://help.salesforce.com/s/articleView?language=en_US&id=platform.flow_task_trigger_run_order.htm&type=5) |
| Recursive save | Skips steps 9 (assignment rules) through 17 | [Order of Execution](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_triggers_order_of_execution.htm) |
| Roll-up summary | Parent record goes through the save procedure before the commit | [Order of Execution](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_triggers_order_of_execution.htm) |
| Post-commit logic | Email, queueable and future jobs, asynchronous flow paths | [Order of Execution](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_triggers_order_of_execution.htm) |
| Static variable in a trigger body | Doesn't keep its value between trigger contexts | [Static Variables](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_static.htm) |

## Check yourself

- Why does a before insert trigger see a value set by a Fast Field Updates flow on the same object?
- When does an after insert trigger on Case see the queue an assignment rule chose?
- Why can't Trigger Order fix two Apex before insert triggers that depend on each other?
- Which work never starts when a save rolls back after a trigger enqueued a Queueable and sent an email?

## Sources

- [Triggers and Order of Execution](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_triggers_order_of_execution.htm)
- [Define the Run Order of Record-Triggered Flows for an Object](https://help.salesforce.com/s/articleView?language=en_US&id=platform.flow_task_trigger_run_order.htm&type=5)
- [Manage Record-Triggered Flows](https://help.salesforce.com/s/articleView?id=platform.flow_trigger_explorer.htm&type=5&language=en_US)
- [Record-Triggered Automation Decision Guide](https://architect.salesforce.com/docs/architect/decision-guides/guide/record-triggered)
- [Before-Save Record-Triggered Flows](https://help.salesforce.com/s/articleView?id=platform.flow_concepts_trigger_record.htm&type=5)
- [Process Order for Salesforce Automation Rules and Apex Triggers](https://help.salesforce.com/s/articleView?id=000385534&language=en_US&type=1)
- [Static and Instance Methods, Variables, and Initialization Code](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_static.htm)
- [How Flows Run in Transactions](https://help.salesforce.com/s/articleView?id=platform.flow_concepts_transaction.htm&type=5)

## About the full unit

The "Core concepts", "Exam traps" and "Worked scenario" sections of this unit, its 9 linked practice questions, and unlimited timed mock exams are included with the Platform Developer II pack (USD $19): https://www.certifyforce.com/practice-exams
