Branching allows you to quickly build complicated flows, especially if you have a workflow with multiple applications and data formats. You can create or edit a branching based on your requirements.
Choose a view which is easy and efficient for you as you make changes and manage branching, that is, a view with or without the input and output pane.
Add branching
You can add branching to a flow when you want to split the data from a step into different parts for further processing. This feature is available for imports and lookups.
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 branching, you should name the branching and configure these components.
| Components | Configure… |
|---|---|
| Branching type | The way in which records must match conditions in all the branches, that is, sequentially or in parallel. |
| Branches | The conditions that records must match in each branch to flow through. (You must also provide a suitable name and description for each branch.) |
- Click → → to create a flow. Or, select an existing flow.
-
After a flow step, click the plus sign (+). From the list, select Add branching.
-
In the Add branching window, enter a name for your branching. You can provide a name that indicates what the branching represents or does in the flow. For example, "Inventory" or "Tiered support" branching. (If your branching name is long, it's shown partially on the Flow builder, but you can see the full name if you hover over it.)
-
Branching type: Choose either the First matching branch or All matching branches. For more information, see Apply branching to your flow.
- Define branch rules: Two branches are automatically included in the Add branching window with default names Branch 1.0 and Branch 1.1.
- Edit the default name and description for the branches.
-
If you want to add another branch, click + Branch and configure details. (You can also reorder , clone, or delete branches.)
- Configure conditions in each branch using either Rules or JavaScript as explained in the following sections. You can also clone or delete conditions.
-
Click Preview and check if you have the required results.
- Input – Preview the input data/record for branching.
- Output – Preview the branch index and name into which the record will move, that is, the first branch that matches or all branches that match the filter condition based on your configuration.
- Click Save and close.
Configure branch conditions using Rules
By default, the Rules format is selected in the right corner to add conditions. You can add rules in a branch based on the conditional and logical operators provided. Only records that match the filter conditions flow through a branch.
Note
Branching supports array type fields that you can use in rules. For more information, see "Branches & array data" in Apply branching to a flow.
You can also add condition groups if required. Groups allow you to segment your filtration logic for complex circumstances if you have a set of rules that use multiple Boolean conditions. For example, you could create one condition group that uses the NOT Boolean operator to exclude records that were created before a certain date, then create another condition group to include records that use the AND or OR operator.
You can collapse and expand conditions in a branch by clicking the arrow icon next to the branch name. By default, the conditions are shown in the expanded format. The rules editor also provides a layout that is clean and efficient to view and manage simple and complex branch rules. Visual and functional cues, such as hierarchical layout and searchable operands, make it easy to add rules and effectively create your branches. You can also
You can also quickly clone or delete conditions. The hand symbol enables you to move and reorder branches. If required, click + Condition to easily add another condition.
Tip
You can also quickly clear all conditions in a branch by clicking → .
- Configure conditions using the conditional and logic operators provided in the Filter editor.
- If required, click Add group to combine conditions.
- Click Preview and check your output, then click Save and Close.
Configure branch conditions using JavaScript
You must first create a script that includes a branching function. Then, you can select it and edit the details in the Branch conditions script section as required.
After you have created a script:
- In the upper-right corner, select JavaScript.
- In the Branch conditions scripts section,
- Under Scripts, select an existing script that includes a branching function. When you select the script, it shows in the Script editor.
- Under Function, select branching if it is not already selected.
- If required, in the Edit branching window, you can edit the branching name.
- Click Preview and check your function output, then click Save and Close.
Edit branchings
You can rename the branching or edit the branches within a branching in your flow. You can add description, reorder, clone, merge, unmerge, or delete branches. Note that the Add branching and Edit branching windows have the same fields. You can also delete a branching.
-
In Flow builder, click the branching router icon. The Edit branching window opens.
-
If required, enter a new name for the branching if you want to edit the name because of scope changes or for any other reason.
When you save the branching, you can see this new name in Flow builder if you hover over the branching router icon.
- If you haven't already changed the default names of the branches, edit the branch name and description.
- If required, reorder, clone, or delete branches.
- If required, refine filter conditions using either Rules or JavaScript. The default option is the Rules format. You can click JavaScript in the top-right corner and edit your script.
- Click Preview and check if you have the required results.
- Click Save and close.
Rename branches and add descriptions
Every branch has a default name. For example, Branch 1.0, Branch 1.1, and so on. You can edit the default branch names and provide a more suitable name, based on the type of branching, the conditions you’ve configured, and your flow. You can rename a branch in either Add branching/Edit branching windows.
-
In the Edit branching window, click the default branch name to rename it.
-
Click the Actions(...) menu to add description.
-
In the Add description pane, enter the description. Click Save & close.
You can now see the new name here and in Flow builder.
Order branches
Note
If you choose All matching branches, you cannot change the order of your branches.
The number that you see in the top-left corner of your branch is the branch index. The branch index starts with 0 and reflects the order or priority of your branches. When you delete or move a branch, the branch index is renumbered accordingly.
To reorder (change the order of) branches:
- At the start of a branch, hover over the dots icon till you see a hand symbol.
- Drag and drop the branch to the desired location.
Clone branches
You can easily clone a branch to create a copy that you can use as-is or modify and use.
To clone a branch,
- Click the Actions (...) menu at the end of a branch.
-
From the list, select Clone branch.
Merge and unmerge branches
You can merge or unmerge branches in Destinations & Lookups based on the merge target paths and points. However, you cannot merge a flow step that was branched back to the step from which it was branched.
A branch merge doesn't merge data back together; it just merges how pages of data continue processing downstream. For example, if you have two records from your source that are on one page of data and then you branch off where one record goes down one branch and the other down another branch, you now have two pages of data, each with one record. After the merge, you will still have two pages of data (not back to one like you originally had), but both pages then proceed to the next step.
A true merge where data from two branches can be combined so that you can process lookups in parallel and then merge results from the various lookups together is currently not supported.
In a linear flow, you will see the merge icon; but, it is disabled because merging is only applicable when you have flow branches.
To merge branches,
-
Click the merge icon (
). As you start dragging the merge icon, you will see various merge paths and merge targets (in light blue).
-
Drop the icon to the required merge target. It changes to dark blue indicating a successful merge. You can now see the merged block, and a new merged flow step is automatically added.
Caution
If you merge a branch that has the branching type as All matching branches, then you will have duplicate records.
To unmerge, you can click ( ) and unmerge a specific branch.
Delete branchings
You can delete a branching. However before you delete a flow branching, it’s good to carefully check whether it’s likely to have an impact on subsequent flows in your process.
To delete a branching:
- Click the branching router icon. The Edit branching window opens.
-
In the Edit branching window, click the overflow menu (...) in the top-right corner. Select Delete branching.
-
Read the message and choose a branch you'd like to retain.
- Select Delete branching.
Tip
You could create a snapshot of your integration before you delete a branching, especially if the integration is in the production environment.
Delete branches
Deleting a branch also removes all associated steps; they will not be visible in Flow builder. If the deleted branch was merged earlier with another branch, the merging point will also be deleted (given that only two branches were merged.)
The index number of the deleted branch is automatically reassigned to the next branch, and the rest of the branches are accordingly renumbered. You can’t delete all the branches in a flow branching; at least, one branch is required. When you have only one branch, it will look like a linear flow but will have the branching router icon.
Note that when you delete a branch, it will also remove any associated steps and branches from this point in the flow.
To delete a branch:
- Click the branching router icon. The Edit branching window opens.
-
Select the specific branch. Click the Actions menu (...) at the end of the row.
- In the list, select Delete branch.
- Read the message, and click Delete.
Sample branching flows
Branching after a merge
Branching within a branch
Single branch in a branching
Empty branch (branch with no conditions) in a branching