Skip to Content

3. Branching

A branching workflow sends each record down one of several routes and then brings them back together. You will build a lead router that sorts incoming leads by region and records every one of them in the same spreadsheet.

Instead of placing every step by hand, you will use the Workflow Assistant to generate the structure, then wire the merge yourself.

🎯

What you will learn: Using AI for the first draft of a structure, conditional branching, and merging branches back into one step.

Before you start: connect Slack and Google Sheets, create four Slack channels for the routes, and prepare a Google Sheet with columns for name, email, and region. If your company manages app approvals centrally, ask an administrator to approve either connection before you begin.


Step 1: Generate the Architecture

Say you want to catch incoming leads from a Webhook and split them into four Slack channels by geographical region.

Prompt the Assistant

Start a fresh workflow, as in Tutorial 2: in the sidebar open Automations and click Create new. Then open the Workflow Assistant: click Assistant in the panel at the bottom right of the canvas, and type:

“Create a webhook trigger. Then add a Conditions step with three routes (US East, US West and Europe), plus an Else route for everything else. Connect a Slack notification step to the end of each route.”

Watch it Build

Hit Enter. The assistant lays out the multi-branch structure on your canvas.

Give the Webhook test data

As in Tutorial 2, click the Webhook step, open Test & Debug, and edit the Testing data (the pencil icon, then Cmd+Enter to apply). Give it a sample lead so there is something to route:

{ "name": "Ana Silva", "email": "[email protected]", "region": "Europe" }

region is the field the Conditions rules will test.

How a Conditions Step Routes

A Conditions step is not a yes/no fork. You give it a list of named conditions and it checks every one of them, firing the branch of each that is true. Anything matching none of them takes the ELSE branch.

That matters here. If a lead could satisfy both “US East” and “US West”, both branches fire and the lead is announced twice. Write the rules so only one can match. And “Other” is not a fourth rule you write. It is the ELSE branch, which fires precisely when the other three did not.


Step 2: Set the Rules

Click the Conditions step to configure each route.

A route’s rule reads the field from the test data: the “Europe” route tests that the webhook’s region equals Europe, picked from the data icon rather than typed. Do the same for the two US routes. The Else route needs no rules of its own — it fires only when none of the other three matched.

While you are here, click each Slack step and write the message for its route.


Step 3: Merge the Branches

Whichever region a lead goes to, you want to record all of them in a single Google Sheet at the end.

Add Google Sheets

Open Apps in the dock, search for Google Sheets, and pick the Add Single Row action. Place it on the far right side of your canvas.

Configure it

Click the step: choose your account (Connect new account… if none is connected yet), then the spreadsheet and the worksheet. Map each column from the webhook’s fields with the data icon (name, email and region), the same move as Tutorial 2’s message field.

Merge the Branches

Click the output terminal (the dot on the right side) of the “US East” Slack step, and drag a line to the input terminal of the Google Sheets step. Repeat this for the other three Slack steps.

Set the merge mode

Click the input terminal on the Google Sheets step and set it to OR (Data from any step). The Google Sheets step then runs as soon as any one of the Slack branches finishes, so every lead is recorded whichever route it took.

OR is the right choice whenever the branches are alternatives, as they are here: a lead takes one route, so the step runs once. The other option, AND (Data from all steps), is for branches that all run every time — a fan-out you deliberately split and want to bring back together once each side has finished.


Step 4: Test & Deploy

You have built a routing workflow that branches four ways and merges back to one record.

Hit Run to test the logic. If you run into unexpected issues or missing data, see the Error Handling Guide.

Once it works, switch the workflow from Draft to Live so its trigger starts firing on its own.


What’s Next?

👉 Choose a Cookbook Workflow →