One Record Triggered Flow Per Object Per Type : Hema

One Record Triggered Flow Per Object Per Type
by: Hema
blow post content copied from  Apex Hours
click here to view original post


As per flow best practices in Salesforce we should create one record triggered flow per object per type. This idea come from Apex trigger framework. As we can create multiple record trigger flow, but it will be difficult to manage those multiple flows. Better we can create two trigger flow for each object, one for before save operation and one for after save operation. In those before and after trigger flow, we can create decision elements and based on decision result we can call sub flows.

Do not create more than one record Triggered flow on any object per type. Follow below Naming Convention for record trigger flow– <ObjectName><event RType>.

  1. ContactBeforeSave
  2. ContactAfterSave
One Record Triggered Flow Per Object Per Type

Advantage of one record triggered flow per object

  1. Creating one Flow per object will enable create reusable Flows and manage all your Flows for a given object in one place.
  2. When you have just one Flow per object per type, You may hit governor limits – such as number of SOQL queries; furthermore,
  3. Adding one Flow per object rule will also allow you to avoid generating infinite loops.
  4. One per object is the only way to enforce order of execution, and if you can’t control that, your troubleshooting will be very difficult.

Consideration

  1. One Record-Triggered Flow Per Object Per Type.
  2. Follow Naming convention for that same flow can be reuse.
  3. In flow builder, we need to create a Decision flow element. Add condition for the in decision flow element and then call sub flow or add your flow execution logic.
  4. Once your action is done in flow then connect the regular connector from the Update Records flow element to the next decision (i.e. “criteria node”) to execute the next flow.

If you are new to Salesforce flow then check our FREE Salesforce Flow Training here.

The post One Record Triggered Flow Per Object Per Type appeared first on Apex Hours.


November 12, 2021 at 05:30PM
Click here for more details...

=============================
The original post is available in Apex Hours by Hema
this post has been published as it is through automation. Automation script brings all the top bloggers post under a single umbrella.
The purpose of this blog, Follow the top Salesforce bloggers and collect all blogs in a single place through automation.
============================

Salesforce