In Flow builder (Build menu > Flow builder), you can now add branching to your flows. Branching decreases your effort to build a flow that has complicated steps with multiple applications or endpoints. For example, you might want to export data from a source application, split/branch the exported data into many different parts, and then import each part into a different destination application or lookup for processing. You can do this by adding branching, rather than building multiple flows. With branching, you are no longer restricted to a linear flow; instead, you can plan and create a flow with many branches to solve your business problems.
In the lower-left corner of Flow builder, different view options are available. You can click an option based on how you want to view your flow branching or flow.
Flow builder supports scrolling, so you can move through your flow horizontally and vertically. This is useful to view large or complicated flows with branching.
You can monitor your flow branching by clicking Dashboard in the left navigation menu.
After you sign in, select Flow builder (Build > Flow builder) and click the plus sign (+) in the Destinations & Lookups in a new flow. Or, you can click the plus sign (+) before or after a flow step in an existing flow.
You can then select Add branching and configure the branching type and branches as required.
After you add a branching, you can see the branching router () icon as shown below.
You can click the branching router icon to edit the branching. Click the icon to define the type of branching. Each dotted line represents a branch . A branch could include several steps based on the workflow. For more information, see Manage branching in your flow.
You can add a maximum of 25 branches (indicated by router icons) in a flow and a maximum of 25 branches (indicated by dotted lines) in a single branching.
Tip
You can easily reorder steps by dragging and dropping them to a different location in your flow. This option can be useful while planning, designing, or testing your flow. All associated tools, such as mappings and filters, move along with the step, preserving your configurations. It's a good practice to check and update your configuration if required after you've reordered any step.
When you add a branching, you must specify:
You must choose the branching type based on how you want data or records to match branch conditions and flow through branches. Choose either of these options:
In this branching type, the order of branches is important because records are matched with the branch conditions sequentially based on the branch index (the order of branches). A record flows through only the first matching branch.
This example shows customer request records flow through the first matching branch based on the customer type which can be subscription tier 1, tier 2, or tier 3.
-
Records that match "tier 1" flow through the "L1 support" branch.
-
Records that match "tier 2" flow through the "L2 support" branch.
-
Records that match "tier 3" flow through the "L3 support" branch.
Records flow through the first matching branch and can be further processed based on the workflow.
In this branching type, the order of branches is not important because records are matched with the branch conditions in parallel. A record flows through all matching branches, that is, a record flows through more than one branch.
This example shows the inventory data for different products that flow through all matching branches based on the product names such as Product A, Product B, or the like.
-
Records that match "Product A" flow through "Store 1," "Store 2," and "Store 3" branches.
-
Records that match "Product B" flow through "Store 2" and "Store 3" branches.
-
All records flow through the "Store 3" branch if no conditions are defined.
Records flow through all matching branches and can be further processed based on the workflow.
You must add branches and configure conditions based on how you want to separate the data into different parts for further processing.
-
Add branches based on the multiple paths that you want records to flow through. When you add your first branching, the Add branching window opens with two branches, Branch 1.0 and Branch 1.1. You can change the default branch names based on your workflow, type of branching, or conditions you’ve configured.
-
Configure conditions based on the records that must flow through each branch for further processing.
Note
If you don’t define any conditions for a branch, it’s considered an empty branch, and all records will pass through the branch.
If the fields you want to use to filter data aren't appearing, your mock output record doesn't meet the filter or branching conditions. Update your mock output record so it satisfies the filter or branching conditions, and the fields will appear.
You can configure conditions using either of the below options.
-
Rules (default) (If you want to add rules for array data, see the Branches & array data below.)
-
JavaScript
For more information, see Manage flow branching.
Branches and array data: You can now easily access the array data from your input record and define branch rules. For instance, in the the field drop-down list of the branch rules editor, you can:
-
View and select the first index.child records of an array.
-
Select records of a primitive datatype array, or click Add field and provide the complete array path for records from the second index onward for an object array.