Complete Execution Flow Diagram
Learning Content
Last updated: July 21, 2026
Complete Salesforce Execution Flow Diagram
Throughout this chapter, you've explored every major stage of the Salesforce Order of Execution. Now it's time to connect those individual pieces into one complete transaction lifecycle.
The following execution flow shows how Salesforce processes a record from the moment a user clicks Save until the transaction is committed and post-commit operations begin.
💡 LearnFrenzy Insight
Think of Salesforce like an airport.
Before a flight takes off, passengers pass through security, identity verification, baggage checks, boarding, and final clearance.
Only after every checkpoint succeeds does the airplane depart.
Similarly, Salesforce validates data, executes automation, performs calculations, commits the transaction, and finally starts background processing.
Complete Salesforce Order of Execution
┌──────────────────────────────────────────────┐
│ USER CLICKS SAVE │
└──────────────────────────────────────────────┘
│
▼
────────────────────────────────────────────────────────
1. System Validation
────────────────────────────────────────────────────────
│
▼
2. Before-Save Flow
│
▼
3. Before Trigger
│
▼
4. Custom Validation Rules
│
▼
5. Duplicate Rules
│
▼
6. Database Save (Not Committed)
│
▼
7. After Trigger
│
▼
8. Assignment Rules
│
▼
9. Auto-Response Rules
│
▼
10. Escalation Rules
│
▼
11. Workflow Rules
│
▼
12. Process Builder (Legacy)
│
▼
13. After-Save Flow
│
▼
14. Roll-Up Summary Calculations
│
▼
15. Criteria-Based Sharing
│
▼
16. Commit Transaction
│
▼
17. Post-Commit Logic
│
├── Email Delivery
├── Queueable Apex
├── Future Methods
├── Platform Events
├── Async Processing
└── Background Integrations
Execution Flow Summary
| Stage | Purpose |
|---|---|
| System Validation | Verify required fields, data types, and system constraints. |
| Before-Save Flow | Efficiently update the triggering record before it is saved. |
| Before Trigger | Apply Apex logic before the record is written to the database. |
| Validation Rules | Enforce business-specific validation logic. |
| Duplicate Rules | Prevent or warn about duplicate records. |
| Database Save | Write the record and assign an Id, but do not commit yet. |
| After Trigger | Create related records and perform post-save Apex processing. |
| Assignment / Auto-Response / Escalation | Execute platform automation for Leads and Cases. |
| Workflow Rules | Perform legacy declarative automation. |
| Process Builder | Legacy visual automation for existing implementations. |
| After-Save Flow | Execute modern declarative post-save automation. |
| Roll-Up Summary | Recalculate parent summary values. |
| Criteria-Based Sharing | Recalculate record visibility when sharing rules apply. |
| Commit Transaction | Permanently save all successful changes. |
| Post-Commit Logic | Execute asynchronous and background processing. |
Execution Timeline
Before Save ───────────────────────────────────────── ✔ System Validation ✔ Before-Save Flow ✔ Before Trigger ✔ Validation Rules ✔ Duplicate Rules Database Save ───────────────────────────────────────── ✔ Record Written ✔ Salesforce Id Assigned ❌ Not Yet Committed After Save ───────────────────────────────────────── ✔ After Trigger ✔ Workflow Automation ✔ Process Builder ✔ After-Save Flow ✔ Roll-Up Summary ✔ Sharing Recalculation Commit ───────────────────────────────────────── ✔ Changes Become Permanent Post Commit ───────────────────────────────────────── ✔ Email Delivery ✔ Queueable Apex ✔ Future Methods ✔ Platform Events ✔ Background Processing
Most Important Concepts to Remember
| Concept | Key Point |
|---|---|
| Before-Save Flow | Fastest way to update the triggering record. |
| Before Trigger | Modify records before the database write. |
| After Trigger | Record Id is available. |
| Database Save | Record exists but rollback is still possible. |
| Commit Transaction | Data becomes permanent. |
| Post-Commit Logic | Runs outside the database transaction. |
| Roll-Up Summary | May update the parent record and trigger additional automation. |
| Criteria-Based Sharing | Controls record access, not business logic. |
Common Interview Questions
| Question | Expected Answer |
|---|---|
| When is the Salesforce Id assigned? | During Database Save, before Commit. |
| Can an After Trigger be rolled back? | Yes, until the transaction is committed. |
| When is rollback impossible? | After Commit Transaction. |
| Why use Before-Save Flow? | Efficient updates to the triggering record. |
| Why use After-Save Flow? | Related records, notifications, cross-object automation. |
| What executes after Commit? | Email delivery, Queueable Apex, Future methods, Platform Events, and other asynchronous processing. |
Execution Flow Cheat Sheet
Easy Way to Remember
Validate
↓
Before Flow
↓
Before Trigger
↓
Validation
↓
Duplicate
↓
Database Save
↓
After Trigger
↓
Automation
↓
After Flow
↓
Roll-Up
↓
Sharing
↓
Commit
↓
Post Commit
✅ Best Practice
When debugging Salesforce automation, always identify where the problem occurs in the execution flow. Understanding the transaction lifecycle helps determine whether the issue originates from validation, Apex, Flow, sharing, or post-commit processing.
⚠️ Common Mistake
Treating all automation as if it executes independently. In reality, most declarative and programmatic automation participates in the same transaction until the Commit Transaction stage, meaning an unhandled exception can roll back the entire unit of work.
🎯 Final Interview Tip
The strongest Salesforce developers don't just memorize the Order of Execution—they understand why each stage exists, what data is available, which automation can run, and when rollback is still possible. This understanding is invaluable for debugging, designing scalable solutions, and succeeding in technical interviews.
🎉 Chapter Completed
Congratulations! You have completed Part 3 – Apex Execution Flow.
You now have a complete understanding of the Salesforce transaction lifecycle—from System Validation through Before-Save Flow, Apex Triggers, Validation Rules, Duplicate Rules, Database Save, Workflow Automation, After-Save Flow, Roll-Up Summary, Sharing, Commit Transaction, and finally Post-Commit Logic.
This knowledge forms the foundation for building reliable Apex applications, designing efficient automation, troubleshooting production issues, and preparing for Salesforce Administrator, Platform App Builder, and Platform Developer certification exams.
Practice What You've Learned
Test your understanding with these practice exercises