This is the age-old apex trigger question, but for flows. Should an object have one after-save trigger flow or multiple?

In apex, it was usually recommended to have a single apex trigger handler that organized which subclass was called based on the type of trigger (after insert, after update, etc.). You would control the order by calling subclasses in a particular order.

Today, when it comes to flows, there are actually two viable patterns.

Pattern 1: Use a single flow per object per action. For example, for account, you would have

  • Account Created – After Save

You can call subflows from this flow, and that works for smaller organizations. For larger ones though, this limits how many developers can work on the main flow and it could create a massively large main flow.

Pattern 2: For larger organizations, it’s better to take advantage of an obscure feature called “Trigger Order”. This feature is buried in the flow settings under “Advanced” and determines the order similar record-triggered flows will execute in.

So you can have the following, knowing they are triggered in a certain order:

  • Account Created – After Save1
  • Account Created – After Save2
  • Account Created – After Save3

When using this pattern, be sure to use increments of 10 instead of 1. This allows you to insert a new flow in between two existing flows and not have to change those existing flows. I also recommend putting the trigger count in the flow name or description.

The result is:

  • Account Created – After Save 10
  • Account Created – After Save 20
  • Account Created – After Save 30

The takeaway
Be sure to apply to appropriate trigger order pattern based on your technical needs.

Category:
Salesforce