Branching lets you send the records from one step down different paths, based on conditions you define. Instead of building several flows, APIs, or tools to handle different cases, you build one and route records to the steps that process them. Branching is available in Flow builder, API builder, and Tool builder. This article explains how branching works, the branching types, and how the three builders differ.
How branching works
A branching splits the records from a step into two or more branches. Each branch has its own conditions, and only records that meet a branch's conditions flow through it. A branch can contain several steps. After you add a branching, the canvas shows a branching router icon, and each dotted line leaving the router is a branch. Select the router icon to edit the branching.
You can add up to 25 branchings (shown as router icons) in a flow, API, or tool, and up to 25 branches (shown as dotted lines) in a single branching.
Each branch has a default name in the format Branch X.0, Branch X.1, and so on, where X is the number of the branching. You can rename branches and add descriptions.
If you don't define conditions for a branch, all records that reach it flow through it.
When to use branching
Use branching when the records from one step need different processing, such as sending each part of exported data to a different destination or lookup, or returning different responses from an API based on request parameters. One flow, API, or tool with branching replaces several near-identical ones, and it's easier to maintain when you work with multiple applications or endpoints.
Don't use branching for create-or-update logic. An import handles that natively with dynamic lookups or field-existence checks, so branching is rarely needed for it.
Branching types
The branching type controls how records are matched against the conditions in your branches.
First matching branch
Records are checked against the branches in order, by branch index. The index starts at 0 and reflects the order of the branches. A record flows through only the first branch whose conditions it meets, so the order of your branches matters.
For example, in a flow that routes customer requests by subscription tier:
- 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.
First matching branch is the default type in Flow builder, and the only type available in API builder and Tool builder.
All matching branches
Records are checked against all branches in parallel, so the order of the branches doesn't matter and you can't reorder them. A record flows through every branch whose conditions it meets, which means one record can flow through more than one branch.
For example, in a flow that routes inventory data by product:
- Records that match "Product A" flow through the "Store 1," "Store 2," and "Store 3" branches.
- Records that match "Product B" flow through the "Store 2" and "Store 3" branches.
- All records flow through the "Store 3" branch if you define no conditions for it.
All matching branches is available in Flow builder only.
Branching support by builder
| Feature | Flow builder | API builder | Tool builder |
|---|---|---|---|
| Branching types | First matching branch, All matching branches | First matching branch | First matching branch |
| Conditions | Rules or JavaScript | Rules or JavaScript | Rules or JavaScript |
| Maximum branchings | 25 | 25 | 25 |
| Maximum branches per branching | 25 | 25 | 25 |
In Flow builder, you can add branching at an import or lookup step. In API builder, every branch must end in an API response, and API builder includes a default branching named Response picker. In Tool builder, every branch must end in a tool output.
View your branches
The builder's lower-left corner has view options for how you see your branching. The builder scrolls horizontally and vertically, which helps when you view large or complex flows, APIs, or tools with many branches.
To monitor a flow's branching, go to Dashboard . For details, see Monitor flows on the Dashboard.