> ## Documentation Index
> Fetch the complete documentation index at: https://loops.so/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Branching workflows

> Branching allows you to send different emails based on a contact's properties within a single workflow.

<Warning>
  Our automation feature "Loops" has been renamed to "Workflows".
</Warning>

A common use case for crafting a user journey is to send different emails based on whether a contact has completed an action or not.

For example, you may want to send a different email to free users versus paid users.

You can do this by adding a **Branch** node to your workflow.

<img src="https://mintcdn.com/loops/QOf1SB2Ha6e9md95/images/loop-builder-branching.png?fit=max&auto=format&n=QOf1SB2Ha6e9md95&q=85&s=476f48722371b927f3c701b617020398" alt="Branches in a workflow" width="2280" height="1479" data-path="images/loop-builder-branching.png" />

## Creating a branching workflow

<img src="https://mintcdn.com/loops/YzXNyAoWJH6Zxv4S/images/loop-builder-branching-add-node.png?fit=max&auto=format&n=YzXNyAoWJH6Zxv4S&q=85&s=1dc0d68fb37d51d32124bf5372321a8e" alt="Adding a node to a branch" width="2280" height="1653" data-path="images/loop-builder-branching-add-node.png" />

To create a branching workflow, click the `+` icon where you want branching to be added and select the **Branch** node type.

Two audience filter nodes are automatically created for you. Edit the audience filter settings for each to send different contacts down each branch, based on their properties.

You can add as many branches as you like to your workflow. Add more branches by clicking the `+ Branch` option that appears on hover just below the Branch node.

Each branch can contain emails, timers, audience filters, more branches, and experiments.

<CardGroup columns="2">
  <Card title="Node types" icon="input-text" href="/workflows#nodes">
    Learn about the different node types.
  </Card>

  <Card title="Experiments" icon="vial" href="/workflows/experiments">
    Add A/B testing to your workflows.
  </Card>
</CardGroup>

## Audience filters

Every branch is defined by an audience filter, which is always the first node in a branch. Filters determine which contacts follow each branch.

When a contact reaches a branch node, the audience filter nodes are evaluated left-to-right as defined in the workflow builder. The contact will proceed to the first matching filter and the remaining filters are skipped. If the contact matches none of the filters, they exit the workflow.

You can create the equivalent of a "default path" by making the right-most filter have empty conditions so that it matches any contact.

<Note>
  #### Upgrade notice

  Previously, a branch node would send contacts who matched multiple filters down multiple parallel branches.

  This behavior has been changed; now, in any new branches added to workflows, contacts will only follow the first branch they match.

  Branches with the old behavior are marked in your workflows. They will retain the old logic until you explicitly press the "Upgrade Branch Node" button shown in the Branch head node's options panel. For more information, see the [branch node upgrade documentation](/workflows/branch-node-upgrade).
</Note>

The audience filter nodes created after a branching node can be toggled between two settings:

* **All following nodes:** The audience filter will apply to *all nodes* downstream of the filter. If a contact stops matching the filter later down the branch, they will be removed from the workflow.
* **Next node only:** The audience filter will only apply when contacts reach the next node in the branch. If a contact stops matching the filter later in the branch, they will remain in the workflow.

<CardGroup columns="2">
  <Card title="Audience filters" icon="filter" href="/workflows#audience-filters">
    Read more about audience filters.
  </Card>
</CardGroup>

## Converging branches

A common use case is to have different branches converge back to the same path. For example, you may want to create branches with different filters that lead to different onboarding emails, but have all branches converge on a single timer that waits a week before sending the same follow-up email.

Here's how you can set up converging paths in a workflow:

<Steps>
  <Step title="Reroute a connection">
    Click **Reroute connection** located below a node.

    <img src="https://mintcdn.com/loops/EzJp4LEUiY1GGCG6/images/reroute-button.png?fit=max&auto=format&n=EzJp4LEUiY1GGCG6&q=85&s=f0268eced39b8d0ac2f3c6c458fd3427" alt="Click reroute button" width="2280" height="1572" data-path="images/reroute-button.png" />
  </Step>

  <Step title="Click on a target node">
    Now select the target node you want to reroute to.

    Since workflows do not allow circular paths, only valid target nodes will be visible, and any invalid target nodes will be dimmed.

    <img src="https://mintcdn.com/loops/EzJp4LEUiY1GGCG6/images/reroute-select-node.png?fit=max&auto=format&n=EzJp4LEUiY1GGCG6&q=85&s=45bd16039ec49a4f00530fea547b004e" alt="Click target node" width="2280" height="1412" data-path="images/reroute-select-node.png" />
  </Step>

  <Step title="End result">
    You'll end up with multiple nodes converging on the same target.

    <img src="https://mintcdn.com/loops/EzJp4LEUiY1GGCG6/images/reroute-done.png?fit=max&auto=format&n=EzJp4LEUiY1GGCG6&q=85&s=2a09ec7139c947e116e8949b75d56ede" alt="Rerouting done" width="2280" height="1479" data-path="images/reroute-done.png" />
  </Step>
</Steps>

## Deleting branches

To delete all branches, select the head Branch node and click the trash icon. This will remove all branches—including all nodes—following it.

<img src="https://mintcdn.com/loops/TjVq5Pxm6qkzPWKN/images/delete-branches.png?fit=max&auto=format&n=TjVq5Pxm6qkzPWKN&q=85&s=a86fe66e99b6f94658800837c0661d0a" alt="Delete branch node" width="2280" height="1452" data-path="images/delete-branches.png" />

If you want to delete a single branch, you can do so by deleting each node in the branch you want removed. When the final node is deleted, the branch will be removed.

<img src="https://mintcdn.com/loops/TjVq5Pxm6qkzPWKN/images/delete-single-branch.png?fit=max&auto=format&n=TjVq5Pxm6qkzPWKN&q=85&s=52d31f3a851e2cb0b9edc290aee713b8" alt="Delete single branch" width="2280" height="1572" data-path="images/delete-single-branch.png" />
