1

If we run a workflow,Process Builder and a Trigger run simultaneously,Which one work first?

  • Please explain how you "run these simultaneously". Do you mean as separate requests or part of a single request? If the latter see the product documentation. – Phil W Apr 21 at 6:58
  • I mean to say that same condition for workflow & Process Builder(for example-Field update on Same Action). – Tarique Shamsi Apr 21 at 7:01
4

Order of execution of Triggers -> Workflows - > Process Builder.

Please see link and point number 12 and 13: Order execution

| improve this answer | |
  • If the condition is same for process builder & workflow,which one result is showed first? – Tarique Shamsi Apr 21 at 7:00
  • If the documentation doesn't say, you cannot make any assumptions as to the relative ordering. – Phil W Apr 21 at 8:40
  • 1
    @TariqueShamsi If a Workflow and Process Builder both have the same conditions and operate on the same field, the Process Builder will happen last, therefore it will "win." – sfdcfox Apr 21 at 11:28
2
  1. The original record is loaded from the database (or initialized for an insert statement)
  2. The new record field values are loaded from the request and overwrite the old values
  3. All before triggers execute (TRIGGERS)
  4. System validation occurs, such as verifying that all required fields have a non-null value, and running any user-defined validation rules (VALIDATIONS)
  5. The record is saved to the database, but not yet committed
  6. All after triggers execute
  7. Assignment rules execute
  8. Auto-response rules execute
  9. Workflow rules execute (WORKFLOW)
  10. If there are workflow field updates, the record is updated again
  11. If the record was updated with workflow field updates, before and after triggers fire one more time (and only one more time)
  12. Escalation rules execute
  13. All DML operations are committed to the database
  14. Post-commit logic executes, such as sending email
| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.