Question

Difficulty: HardOrder of Execution and Automation Considerations

A Salesforce administrator is troubleshooting an automated Lead ingestion process from an external web form. The Lead object has several automation features configured: custom Validation Rules, a Before-Save Record-Triggered Flow that populates missing field values, standard Lead Assignment Rules, and an After-Save Record-Triggered Flow that sends an outbound notification. Which sequence accurately describes the order in which Salesforce executes these features during the record save operation?

  1. Before-Save Record-Triggered Flow → Custom Validation Rules → Lead Assignment Rules → After-Save Record-Triggered FlowAnswer
  2. B
    Custom Validation Rules → Before-Save Record-Triggered Flow → Lead Assignment Rules → After-Save Record-Triggered Flow
  3. C
    Before-Save Record-Triggered Flow → Lead Assignment Rules → Custom Validation Rules → After-Save Record-Triggered Flow
  4. D
    Custom Validation Rules → Lead Assignment Rules → Before-Save Record-Triggered Flow → After-Save Record-Triggered Flow

Answer

The correct sequence is: Before-Save Record-Triggered Flow, followed by Custom Validation Rules, then Lead Assignment Rules, and finally After-Save Record-Triggered Flow.
In the Salesforce transaction order of execution, high-level automation steps execute in a strict sequence: (1) System validations pass, (2) Before-Save Record-Triggered Flows execute to modify record values in memory, (3) Custom Validation Rules evaluate the updated field values, (4) The record is saved to the database (uncommitted), (5) Apex after-triggers and Lead Assignment Rules execute to reassign ownership, and (6) After-Save Record-Triggered Flows execute near the end of the transaction before final commit.

Step-by-Step Solution

1
Identify the pre-save automation phase.
Before-Save Record-Triggered Flows execute before Apex before-triggers and before custom validation rules run.
This allows before-save flows to set or update field values on the record prior to validation checks.
2
Determine where validation rules fit into the execution order.
Custom Validation Rules execute after system validations, before-save flows, and before-triggers, but before the record is saved to the database.
Validation rules verify the updated state of the record (including changes made by before-save flows).
3
Identify the post-save automation sequence.
After the record is saved to the database and Apex after-triggers execute, Salesforce executes Assignment Rules (for Leads/Cases), Auto-Response Rules, Workflow Rules, Escalation Rules, and then After-Save Record-Triggered Flows.
Assignment rules operate on saved records to reassign ownership, which occurs before after-save flow execution.

Key Concept

Salesforce Architecture Order of Execution Sequence
Estimated Time:2m 0s
Rate this question