# Run branches in parallel

import { Steps } from "@astrojs/starlight/components"

A **Parallel** step is a **Flow** container that runs multiple branches at the same time. Each branch holds its own
nested steps. When every branch finishes, Studio continues from the merge after the Parallel block and exposes the
combined branch output to later steps. Screenshots on this page use a sample **Notify channels** flow with two Slack
branches.

## When to use

- Two or more paths do not depend on each other's results and can run concurrently (for example notify Slack and email
  at once).
- You want wall-clock speed without chaining unrelated service calls in series.
- Prefer **For each** in [Create a loop](../create-a-loop/) when the same steps must repeat for every item in an array,
  not for unrelated branches.
- Prefer [Branch with a Condition](../condition/) when only one path should run.

Before you begin, open the flow in the designer with permission to edit it.

## Guide

### Add a Parallel step

The **Parallel** step creates one branch when you add it. Use **Add a step** on branch links to add more parallel paths.

<ol>
<li>

**Open Add a step.** On the canvas, choose **+** where the parallel block should start (after the trigger or an earlier
step).

</li>
<li>

**Choose Parallel.** Under **Flow**, select **Parallel**. Studio places a Parallel container on the canvas with an
initial branch.

</li>
<li>

**Rename the step.** Give the step a title that matches the job (for example **Notify channels**).

</li>
<li>

**Add steps on each branch.** Open **Add a step** on a branch link inside the container and add the steps that branch
should run. Repeat for each branch you need.

<div class="docs-screenshot-compact">

![Notify channels Parallel block with Notify Slack and Notify email branches and Store notification status after the merge](./assets/parallel-step-notify-channels-on-canvas.png)

</div>

</li>
<li>

**Add another branch.** Use **Add a step** on the Parallel step or on branch links to create another parallel branch
when a third or fourth path should run concurrently.

</li>
<li>

**Continue after the merge.** Add steps after the Parallel container (on the outgoing link from the merge) to process the
combined result once all branches complete.

</li>
</ol>
### Use branch output later

After a Parallel step finishes, the data picker exposes output from the Parallel step for downstream fields and
formulas. Pick values under **Flow** → your Parallel step when you build later steps.

<ol>
<li>

**Open a downstream field.** Select a step after the Parallel block and open a field that accepts data or a formula.

</li>
<li>

**Open the data picker.** Type `/` and navigate to **Flow** → your Parallel step to insert branch results available at
the merge.

</li>
</ol>
## Example

An operator builds **Notify channels** starting after a webhook trigger. They add **Parallel** **Notify channels**,
then one branch sends a Slack message to `#incidents` and another sends email to `oncall@example.com`. A **Transform
data** step after the Parallel container stores the merged output in `notification_status` for logging.

## Keep in mind

- Branches should be independent. Do not assume one branch finishes before another starts.
- Every branch must reach the merge. A failing step stops that branch unless you use **On failure** → **Continue
  execution** per [Handle step errors](../error-handling/).
- **For each** concurrency in Settings is not the same as **Parallel**; use **Parallel** when paths are different steps,
  not the same step over many array items.

## Related

[Create a loop](../create-a-loop/) · [Branch with a Condition](../condition/) · [Scripts, errors, and run control](../)
