Platform
Salesforce order of execution: debug the record save
Use the Salesforce save sequence to locate field changes, validation failures, recursive updates and work that runs only after commit.
An after-save flow can fail and roll back the save. “After save” doesn’t mean that the transaction has committed.
Use Salesforce’s current order-of-execution reference when tracing a record write. The sequence includes version-specific and recursive-save qualifications, so a memorized diagram can miss behavior that matters in your org.
Start with the stages that change the diagnosis
Before-save record-triggered flows run before before triggers. Custom validation and duplicate-rule processing occur before the normal after-trigger stage. After-save record-triggered flows still participate in the save before commit; asynchronous paths and enqueued jobs are examples of post-commit work.
That abbreviated sequence helps locate a symptom, but it isn’t a substitute for the complete reference. Workflow field updates, related-record updates and recursive saves have their own rules. Record the API version and automation type when investigating them.
For a validation failure, inspect the values after earlier automation has modified them. The request payload may not contain the value that the validation rule evaluated. For an unexpected final value, identify every writer of that field.
Trace one record through the complete operation
Build a small investigation sheet containing the input values, executing user, automation entry points and expected final state. Capture a debug log from a reproducible sandbox example and mark where each relevant field changes.
Then repeat with a bulk input. Multiple records can take different branches, and related updates may consume shared transaction resources. A successful manual edit of one record doesn’t prove that an import follows the same request-specific validation behavior.
Avoid assuming that multiple triggers on the same object and event run in a chosen order. Consolidate ordering where your architecture requires it, and use the platform’s supported Flow ordering controls for the applicable flow types.
Separate database success from later work
A committed record doesn’t prove a background integration completed. Track the asynchronous operation separately and show its confirmed result. Conversely, a remote side effect may survive a Salesforce rollback, so cross-system work needs idempotency and reconciliation.
For same-record field changes, compare before-save and after-save Flow. Choose the execution point from the data and actions required, not from the label that sounds latest.
Test a rejected save, a related-record update, a repeated transition and a post-commit worker failure. The useful outcome is a traceable explanation of which stage owns each business effect. That makes later automation changes reviewable instead of dependent on institutional memory.