When implementing automation in Salesforce — such as Apex triggers, Workflow Rules, Process Builder flows, and validation rules — understanding the order in which these automations execute is critical to avoid unexpected behavior, data integrity issues, or infinite loops.
Salesforce follows a defined order of execution for each save operation (insert, update, upsert, delete, undelete). You can refer to the Apex Developer Guide — Triggers and Order of Execution for the full sequence.
This article provides key reminders about that order and highlights common edge cases to be aware of when designing automation in Salesforce.
Real-life example: If you have both an Apex trigger and a Workflow Rule that update the same field on an Account record, the Workflow field update runs after the Apex trigger completes, but it will NOT re-fire the Apex trigger. This is important to know when designing automation that depends on the final field value.
000385534

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.