Order of Execution Interview Questions test whether you know what Salesforce does, step by step, when a record saves. Interviewers love this topic, because it explains many strange bugs. For example, why a validation rule sees a trigger’s change, or why a trigger runs twice.
Last reviewed for the Winter ’27 release (November 2026).
This is Part 12 of our Salesforce developer interview series. It covers the save order, automation timing and tricky cases, from simple to advanced, with short answers. It builds on the Apex order of execution for developers, the Salesforce order of execution and Part 11 on trigger frameworks.
What are Order of Execution Interview Questions?
Order of Execution Interview Questions test the fixed sequence of events Salesforce runs when you insert, update or upsert a record. The sequence includes validation, before-save flows, triggers, duplicate rules, after-save flows, roll-ups and the final commit. So you can predict exactly what each automation sees.
Think of an airport. You check in, pass security, wait at the gate and only then board. Each step must finish first, and failing security stops everything after it. The save order works the same way.
Why Order of Execution Interview Questions Matter
Many bugs come from automations that run in an unexpected order. Here is why Order of Execution Interview Questions matter.
- First, it tells you where to put each rule, flow or trigger.
- Also, it explains why some triggers fire twice in one save.
- Next, it shows when emails and async jobs really run.
- Roll-up summaries cause parents to save too, which surprises many developers.
- Finally, senior interviews nearly always include “walk me through the save order”.
So a clear answer here shows deep platform knowledge.
How to Prepare for Order of Execution Interview Questions
Preparing for Order of Execution Interview Questions follows five steps. First, learn the main steps in groups: load, before, validate, save, after, commit. Next, place each automation type in its group. Then learn the workflow re-fire rule and the recursive save rule. After that, study roll-up and cross-object effects on parents. Finally, explain one real bug that the save order solved.

Order of Execution Steps at a Glance
The table below lists the documented steps in order.
| Step | What runs |
|---|---|
| 1 | Load the original record or start a new one |
| 2 | Load new values and run system validation |
| 3 | Before-save record-triggered flows |
| 4 | Before triggers |
| 5 | System validation again and custom validation rules |
| 6 | Duplicate rules |
| 7 | Save to the database, not committed |
| 8 | After triggers |
| 9 | Assignment rules |
| 10 | Auto-response rules |
| 11 | Workflow rules and their field updates |
| 12 | Escalation rules |
| 13 | Processes and flows launched by workflow |
| 14 | After-save record-triggered flows |
| 15 | Entitlement rules |
| 16 | Roll-up summary in the parent |
| 17 | Roll-up summary in the grandparent |
| 18 | Criteria-based sharing evaluation |
| 19 | Commit all DML |
| 20 | Post-commit logic, such as email and async jobs |
Before-Save Flows vs Before Triggers
The table below compares the two “before” automations, a common question here.
| Feature | Before-save flow | Before trigger |
|---|---|---|
| Runs | Step 3, first | Step 4, after the flow |
| Built with | Flow Builder | Apex |
| Changes same record | Yes, no DML | Yes, no DML |
| Related records | Read only | Read with SOQL |
| Speed | Very fast | Fast |
When to use which is simple. Use a before-save flow for simple field updates, while a before trigger fits complex logic or high volume.

Basic Order of Execution Interview Questions
These Order of Execution Interview Questions cover the main steps and their order.
Questions on the Main Steps
The diagram below shows all 20 steps, grouped by phase, so you can follow each answer.

Q1: What is the order of execution?
It is the fixed sequence of events Salesforce runs when a record is saved. So each automation runs at a known point.
Interview tip: open with “before, save, after, commit, post commit”. It gives the interviewer a frame before the details.
Q2: Which DML operations follow the order of execution?
Insert, update and upsert follow the full save order. Delete and undelete run their own trigger events.
Follow-up you may get: Do delete triggers run validation rules? No, validation rules run only on insert and update.
Q3: What runs first on the server?
Salesforce loads the original record, or starts a new one for insert. Then it loads the new field values.
Q4: What validation runs on the client?
Only JavaScript checks for dependent picklists in the browser. All other checks run on the server.
Q5: Which runs first, before-save flows or before triggers?
Before-save flows run first, then before triggers. So a trigger sees changes the flow made.
Interview tip: say why it matters: a trigger can overwrite a flow’s value without anyone noticing.
Q6: When do custom validation rules run?
After before triggers, in step 5. So validation rules see values changed by triggers and flows.
Q7: When do duplicate rules run?
After validation rules and before the record saves. If a rule blocks, nothing after it runs.
Interview tip: mention that a blocking duplicate rule stops everything after it, including after triggers.
Q8: When is the record saved?
In step 7, it is saved to the database but not committed. So later steps can still roll it back.
Follow-up you may get: Is the record visible to other users after step 7? No, not until the commit.
Q9: When do after triggers run?
Right after the record saves, so the Id and system fields are set. Then assignment and auto-response rules follow.
Q10: Where do before-save flows fit compared with system validation?
System validation runs first, then before save flows, then before triggers, then custom validation rules. So a before save flow can fill a required value that a validation rule will check later, but not a value that system validation already rejected.
Q11: When do after-save flows run?
After workflow rules, escalation rules and processes, and before entitlement rules. So they see most earlier changes.
Follow-up you may get: Can an after save flow change the triggering record? Yes, but it runs a new update, so use before save where you can.
Questions on Validation Steps
Validation-focused Order of Execution Interview Questions check which checks run when.
Q12: What system validation runs for a standard UI edit page?
Layout rules, required fields at layout and field level, field formats and maximum lengths. So UI saves get extra checks.
Q13: What validation runs for Apex or API saves at step 2?
Foreign keys, field formats, maximum lengths and restricted picklists. However, layout rules do not apply.
Q14: Which system check is not run a second time in step 5?
Layout-specific rules, when the request comes from a standard UI edit page. All other checks run again.
Q15: Can a before trigger fix a value before validation rules run?
Yes, because validation rules run after before triggers. So a trigger can set a required value.
Interview tip: this explains why defaults belong in before triggers. Connect the two.
Q16: Can a validation rule block a value that a before-save flow set?
Yes, the validation rule runs later and sees the flow’s value. So it can still fail the save.
Q17: Do validation rules run on records loaded with Data Loader?
Yes. Data Loader uses the API, so custom validation rules, triggers and flows all run. If a load is failing on rules that should not apply, fix the data or add a bypass condition the business agrees to, like a custom permission check in the rule.
Q18: Do validation rules run again after workflow field updates?
No, custom validation rules do not run again then. Only system validations rerun.
Custom validation rules run only once per save, before the record is written. A later field update in the same save is checked only by system validation, like field lengths.
Intermediate Order of Execution Interview Questions
These Order of Execution Interview Questions cover re-fires, rules and roll-ups.
Questions on Workflow and Re-Fires
Q19: What happens when a workflow field update fires?
Salesforce updates the record again and runs system validation again. Then before update and after update triggers fire one more time.
Q20: Do triggers re-fire as update even for an insert?
Yes, the extra run uses before update and after update, whatever the original operation. So handlers must expect update context.
Interview tip: this catches handler code that branches on isInsert. Say so.
Q21: How many times can workflow re-fire the triggers?
Only one more time. Triggers can run at most twice for one save because of workflow.
Salesforce stops after that second pass even if the second update would trigger the rule again. This applies to older orgs that still have workflow rules running.
Q22: What does Trigger.old show on the workflow re-fire?
It shows the record before the original update, not after the first pass. So comparisons can surprise you.
Q23: Are flows, duplicate rules and processes run again after a workflow update?
No, custom validation, flows, duplicate rules, processes and escalation rules are not run again. Only triggers re-fire.
Q24: How do flows that update the same record compare with workflow re-fire?
An after save flow that updates the triggering record runs a new DML, which goes through the whole save order again, including validation rules. That is heavier than the old workflow re-fire, so prefer before save flows for same record changes.
Q25: Can you still create new workflow rules?
No, workflow rules and Process Builder are retired for new automation. However, existing ones still run in this order.
Note: Salesforce ended support for Workflow Rules and Process Builder on 31 December 2025. They still run in orgs that have them, but they should be migrated to flows.
Questions on Rules and Roll-Ups
Q26: When do assignment rules run?
After after triggers, in step 9. So triggers cannot see the final owner from assignment rules.
Follow-up you may get: Which objects have assignment rules? Leads and cases.
Q27: When do auto-response rules run?
After assignment rules, in step 10. For example, they send case or lead auto-reply emails.
Q28: When do escalation rules run?
After workflow rules, in step 12. They apply to cases only.
Escalation rules move cases to another owner or notify someone when they stay open too long, like a high priority case not answered within 4 hours.
Q29: When do entitlement rules run?
After after-save flows, in step 15. In API 53.0 and earlier, after-save flows ran after entitlements.
Q30: What happens when a child record has a roll-up summary on its parent?
Salesforce recalculates the roll-up and the parent goes through its own save. So parent triggers and flows run too.
Interview tip: name the hidden cost: one child save can run the parent’s whole automation.
Q31: Can the grandparent save as well?
Yes, if the parent update changes a roll-up on the grandparent. Then the grandparent goes through the save as well.
Q32: When is criteria-based sharing evaluated?
Near the end, in step 18, after roll ups. Then all the DML commits.
Criteria based sharing rules look at field values, so Salesforce waits until every field has its final value before deciding who gets access.
Q33: When does a roll-up summary field recalculate?
When a child is inserted, updated, deleted or undeleted, Salesforce recalculates the parent’s roll up in step 16, and the parent goes through its own save. If the parent’s roll up changes a grandparent roll up, the grandparent saves too.
Q34: What does Salesforce skip during a recursive save?
Steps 9 through 17, from assignment rules to grandparent roll-ups. So those run only once per record save.
Follow-up you may get: Why skip those steps? To stop rules like assignment from running again and again in one save.
Advanced Order of Execution Interview Questions
These Order of Execution Interview Questions cover commit, async timing and tricky behaviour.
Questions on Commit and Post-Commit Logic
Q35: When are changes committed?
In step 19, after all automation finishes. If anything fails before that, everything rolls back.
Interview tip: stress that nothing is permanent until commit. It answers many follow ups.
Q36: When are emails sent?
After the commit, as post commit logic. A save that rolls back sends no email.
That protects customers from getting a confirmation for an order that was never saved. Emails sent from Apex with Messaging.sendEmail follow the same rule.
Q37: When do future and Queueable jobs start?
After the commit, as post commit logic, so they see the committed data.
| Post commit item | Runs in |
|---|---|
| Emails from Apex, flows and alerts | After the commit |
| Future and Queueable jobs | Their own new transaction |
| Asynchronous paths in record triggered flows | Their own new transaction |
| Outbound messages | After the commit |
None of these run if the save fails, and their order is not guaranteed.
Q38: When do asynchronous paths in record-triggered flows run?
After the commit, with other post commit logic, in their own transaction.
Use an asynchronous path for slow work, like a callout or a large update on related records, so the user’s save stays fast and does not share its limits.
Q39: Is the order of post-commit actions guaranteed?
No, email, async jobs and async flow paths run in no particular order. So do not depend on one finishing first.
Q40: Can a platform event published in a trigger fire before the commit?
Yes, if the event is set to Publish Immediately, subscribers can get it even if the transaction later rolls back. Set it to Publish After Commit when subscribers must only see events for saved data.
Q41: What happens to enqueued jobs if the transaction fails?
They are not started, because the commit never happens. So no async work runs for failed saves.
Interview tip: give an example: a failed order save never enqueues the shipping callout.
Questions on Tricky Behaviour
Q42: Two before insert triggers exist on Case. Which runs first?
The order is not guaranteed, so you cannot rely on it.
Salesforce may run them in any order. Keep one trigger per object and control the order inside a handler class.
Q43: How do you control the order of several record-triggered flows?
Set Trigger Order values and use Flow Trigger Explorer. Then flows run in that order within their step.
Follow-up you may get: Does Trigger Order affect Apex triggers? No, only flows; Apex trigger order is still not guaranteed.
Q44: In what order do Process Builder processes and workflow-launched flows run?
In step 13, they run in no guaranteed order. That is one reason Salesforce asks you to move them to record-triggered flows.
Q45: How does partial success change the order?
If some rows fail, Salesforce rolls back and runs the save steps again for good rows. So triggers fire again, and static variables are not reset.
Interview tip: link this to triggers needing to be safe to run twice.
Q46: Do before triggers see field values set by default values on the field?
Yes, default values are set when the record is created, before triggers run. However, formula values may not be updated yet.
Follow-up you may get: How do you get fresh formula values in Apex? Call Formula.recalculateFormulas on the records.
Q47: Why might an after trigger see an old owner on a lead?
Because assignment rules run after after triggers, so the new owner is set later in the save.
If your logic needs the final owner, use an after save flow, which runs after assignment rules, or a queueable that reads the committed record.
Q48: Can a validation rule see the record Id on insert?
No. The ID is set only when the record saves in step 7, and validation runs before that.
On insert, a formula like ISBLANK(Id) is always true in a validation rule. Use ISNEW() to tell insert from update instead.
Q49: Does a duplicate rule block stop after triggers?
Yes, a blocking duplicate rule stops the save, so after triggers and later steps do not run.
Q50: Where does a roll-up from a child update cause parent recursion?
When the parent’s own save, caused by the roll up, fires parent triggers that update the children again.
Each update of a child recalculates the roll up, so the loop can repeat. Guard both sides with changed fields checks, and avoid updating children from the parent when the roll up was the only change.
Q51: Does the order of execution change for records saved from Apex versus the UI?
The steps are the same. The UI adds layout checks in system validation, like required fields on the page layout. Apex and API saves skip those layout checks but run every other step.
Q52: Can a flow DML in step 13 or 14 start another save?
Yes, any DML on another record sends that record through its own save order. So chains can grow long.
Follow-up you may get: Does that second save share limits? Yes, it runs in the same transaction.
Scenario-Based Order of Execution Interview Questions
Scenario-based Order of Execution Interview Questions ask you to explain a real bug.
Questions on Real Bugs
Q53: A validation rule fails even though a trigger fixes the field. Why?
The fix is probably in an after trigger, which runs after validation. So move it to a before trigger.
Interview tip: the fix is always “move it to before”. Say it first, then explain.
Q54: A trigger runs twice on one update. What do you check first?
Check for a workflow field update or a roll-up that saves the record again. Then add a changed-fields check.
Q55: A welcome email goes out even when the save fails later. Is that possible?
Not for standard email actions, because emails send after commit. However, a callout that sends email can leak.
Q56: A before-save flow and a before trigger both set Status__c. Which value wins?
The trigger’s value wins, because before triggers run after before save flows.
Two tools setting the same field is a design smell. Pick one owner for the field, usually the flow for simple defaults, and remove the other.
Q57: An after-save flow cannot see the owner set by an assignment rule. Why?
Actually it can, because after-save flows run after assignment rules. So check the flow’s entry conditions instead.
Q58: A parent account trigger fires when an opportunity changes. Why?
A roll up summary or a cross object update saves the parent, so the account runs its own save order.
Example: a roll up of opportunity amounts on Account recalculates when an opportunity changes, and that update fires the account’s triggers and flows.
Q59: A Queueable reads stale data in a test. Why?
The queueable runs after commit, which in a test happens at Test.stopTest. Assertions before stopTest see old data.
Enqueue the job between Test.startTest and Test.stopTest, then query the records again and assert after stopTest.
Q60: Async flow paths run before a related Queueable. Can you rely on that?
No. The order of post commit work is not guaranteed.
Design each one so it works on its own, for example by having the queueable read the data it needs instead of expecting the flow path to have finished.
Q61: An after trigger updates a field, and a validation rule then fails on it. Why?
The update from the after trigger is a new DML on the record, which goes through the save order again, including custom validation rules. Move the field change to a before trigger so it saves with the record and the rule sees the right value the first time.
Q62: A duplicate rule blocks records loaded by an integration. Where do you fix it?
Check the duplicate rule settings or pass allowSave in DMLOptions. Then the trigger chain continues.
Questions on Design Choices
Q63: Where do you put a rule that sets a default field value?
In a before save flow or a before trigger, so no extra DML runs.
A field’s default value setting is even simpler when the default does not depend on other fields. Before save options run in the same save, which keeps it fast.
Q64: Where do you create child records after an insert?
In an after trigger or after-save flow, because the parent Id exists then. Also, bulkify the inserts.
Follow-up you may get: Flow or trigger for child records? A flow for simple creation, a trigger for complex or high volume logic.
Q65: Where do you put a callout that must follow a save?
In a Queueable or an asynchronous flow path, after commit. So the save is never blocked by the remote system.
Interview tip: name the error you avoid, “You have uncommitted work pending”.
Q66: How do you explain the order in under 30 seconds?
Load, before save flows, before triggers, validation, duplicate rules, save, after triggers, assignment and auto response rules, after save flows, roll ups, sharing, commit, then post commit work.
| Stage | What runs |
|---|---|
| Before the save | Load values, system validation, before save flows, before triggers, custom validation, duplicate rules |
| Save | Record written to the database, not yet committed |
| After the save | After triggers, assignment, auto response, escalation and entitlement rules, after save flows |
| Related records | Roll up summaries on parent and grandparent |
| End | Criteria based sharing, commit |
| After commit | Emails, async jobs, async flow paths |
In older orgs, add that a workflow field update re-fires the update triggers once.
Q67: How do you see the order of automation on one object?
Open Flow Trigger Explorer in Setup to see record triggered flows by event and order, and check the object’s Apex triggers in Setup. A debug log of a test save shows the real order step by step.
Q68: How do you debug a confusing save?
Read a debug log with Workflow and Apex at FINE level. Each step shows in order, so you can see who changed what.
A Real Order of Execution Interview Questions Answer
A classic live task is “a course trigger sets Seats_Left__c, a validation rule checks it, and the trigger runs twice”. Here is a strong answer.
trigger CourseTrigger on Course__c (before insert, before update) {
for (Course__c c : Trigger.new) {
Course__c old = Trigger.isUpdate ? Trigger.oldMap.get(c.Id) : null;
Boolean changed = old == null ||
old.Capacity__c != c.Capacity__c ||
old.Enrolment_Count__c != c.Enrolment_Count__c;
if (changed) {
c.Seats_Left__c = (c.Capacity__c == null ? 0 : c.Capacity__c) -
(c.Enrolment_Count__c == null ? 0 : c.Enrolment_Count__c);
}
}
}
Explain that the trigger runs in step 4, so the validation rule in step 5 sees the new seat count. Next, a roll-up from enrolments saves the course again, which re-fires the trigger. So the changed-fields check makes the second run do no work.
Common Mistakes with Order of Execution Interview Questions
- Saying validation rules run before triggers.
- Forgetting that before-save flows run before before triggers.
- Expecting assignment rules to finish before after triggers.
- Believing async jobs run inside the same transaction.
- Forgetting that roll-ups make the parent save too.
Best Practices for Answering Order of Execution Interview Questions
- Group the steps instead of reciting twenty numbers.
- Always mention the workflow re-fire and the commit step.
- Tie each step to a real bug you have seen.
- Say where you would place a given rule and why.
- Point to the Apex Developer Guide page for the latest order.
Official Resources
- Triggers and Order of Execution (Apex Developer Guide)
- Order of Execution Flowchart (Salesforce Data Model Gallery)
- Manage Record-Triggered Flows (Salesforce Help)
Quick Recap
- Order of Execution Interview Questions cover every step from load to post-commit.
- Before-save flows run before before triggers, and validation comes after both.
- Workflow field updates re-fire update triggers only one more time.
- Roll-ups send parents and grandparents through their own save.
- Emails and async jobs run only after the commit.
What’s Next?
Next, read Governor Limits Interview Questions and Bulkification (60+ Q&A).


