Sub topic 14
Consolidating automation per object and controlling flow order
This chapter assumes you have an inventory of your Workflow Rules and processes, and that you know where flows run in the order of execution. It covers how to group automation by object and how to control the order in which the resulting flows run.
Why consolidate
A migrated org often has several Workflow Rules and processes on one object. If you convert each one into its own flow, you get many flows on the same object. They all fire on the same save. Their order is hard to predict, and they can overwrite each other's field values.
Consolidation reduces that risk. It also means fewer flow interviews run per save, and one place to look when something breaks.
Group by object and trigger
Start from the inventory. Sort the list by object, then by when each automation runs: on create, on update, or on both. Then sort by whether it changes the triggering record or does something else.
Use these working rules:
- Put all field updates on the triggering record in one before-save flow per object.
- Put actions on other records, emails, and Apex calls in one after-save flow per object.
- Keep separate flows for logic that is unrelated or owned by different teams.
- Use decisions inside a flow to separate what used to be separate criteria.
One flow per object and trigger is a starting point, not a rule. A very large flow is hard to read and test. Split it when it passes what one admin can review comfortably.
Controlling flow order
Before-save flows run before after-save flows, so the split above already gives you a basic order. When you have more than one flow of the same type on an object, you can set a trigger order.
- Open Setup and go to Flow Trigger Explorer.
- Select the object and the trigger type.
- Drag the flows into the order you want, or assign each one an order value from 1 to 1000.
Flows with an order value run first, from lowest to highest. Flows with no value run after them, in no guaranteed order. Give every flow on a busy object a value.
You can also set the order in the flow itself. In the Start element, open the advanced options and enter a trigger order value.
Avoiding conflicts
When two flows update the same field, the last one to run wins. Use these habits to prevent surprises:
- Assign each field to one flow where possible.
- Do not rely on flow order to fix a design where two flows disagree.
- Name flows with the object, trigger, and purpose, such as
Opportunity_BeforeSave_Defaults. - Document the order in the flow description.
Exercise
An Account has two Workflow Rules that update fields on Account and one process that creates a Case. How would you consolidate these into flows, and what is the order between them?
Show answer
Put both field updates in one before-save flow on Account, because they change the triggering record. Put the Case creation in an after-save flow, because it works on another record. The before-save flow runs first, then the after-save flow, so the field values are already set when the Case is created.