> For the complete documentation index, see [llms.txt](https://docs.nected.ai/nected-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.nected.ai/nected-docs/workflow/add-node/control-nodes/parallel-block.md).

# Parallel Block

The **Parallel Block** is a control node that splits your workflow into two or more paths and runs every path at the same time. When all the paths have finished, the workflow joins back at a single point, **Parallel Done**, and continues with the next node.

In a traditional sequential setup, each node waits for the one before it to finish. That is fine when a step depends on the previous step's output, but it wastes time when the steps are independent of each other. For example, fetching a customer's credit score, KYC status and order history are three separate calls. Running them one after another makes the workflow as slow as all three calls added together.

The Parallel Block removes that wait:

* **Concurrent Execution**: Every path starts at the same time, so the block takes roughly as long as its slowest path instead of the sum of all paths.
* **Simplified Workflow Management**: Independent tasks sit side by side on the canvas, and the outputs of every path are available to all the nodes after **Parallel Done**.

{% hint style="info" %}
**Parallel Block or Switch Block?** The two nodes do different jobs. The Parallel Block runs **all** of its paths at the same time and has no conditions to configure. The Switch Block is for conditional routing: it checks conditions and runs the **one** path that matches. Use the Parallel Block to speed up independent tasks, and the Switch Block to decide which task should run.
{% endhint %}

### Adding the Parallel Block

1. **Select a Workflow**: Open an existing workflow or create a new one.
2. **Add Parallel Block**: Click the **+** button where you want the paths to start. In the **Add Node** menu, select **Parallel** from the control nodes row at the bottom.

<figure><img src="https://4290782554-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLg716fCfV8IUwXQygkTG%2Fuploads%2FpWKVOhcBuwRFyKKjP0yS%2Fimage.png?alt=media&#x26;token=98dc011c-2d07-461d-a8b8-3dcb51a6f20d" alt=""><figcaption></figcaption></figure>

And you're done. A node named **ParallelBlock** is added with two paths, **Path1** and **Path2**, joined by **Parallel Done**. The configuration panel opens automatically.

### Configuring the Parallel Block

The configuration panel has three tabs: **Input Params**, **Test Results** and **Settings**. Once the paths are set up, you add the actions each path should run on the canvas.

#### Input Params

Every path is listed as a numbered card with two fields:

1. **Name** (required): A unique name for the path. The Parallel Block reports the result of each path under this name, so pick something descriptive, such as `CreditCheck` or `KYC_Check`.
2. **Description** (optional): A short note about what the path does.

Click **+ Add Path** to add another path, or the delete icon next to a path to remove it. Click **Save** when you're done. The canvas updates to show one branch for every path.

<figure><img src="https://4290782554-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLg716fCfV8IUwXQygkTG%2Fuploads%2FAqP89grdZvi4PCJXQWRN%2Fimage.png?alt=media&#x26;token=c1ab0156-0499-4f6a-a744-4725d836043d" alt=""><figcaption></figcaption></figure>

Path names must follow these rules:

| Rule                                                                              | Error shown if broken                     |
| --------------------------------------------------------------------------------- | ----------------------------------------- |
| A name is required.                                                               | `Name cannot be empty`                    |
| Use only letters, numbers and underscores (`_`). No spaces or special characters. | `Only letters, numbers and _ are allowed` |
| Each name must be unique within the same Parallel Block.                          | `Duplicate path name`                     |

{% hint style="info" %}
A Parallel Block needs at least **2** paths and can have up to **10** paths. The delete icon stays disabled while the block has only two paths, and adding an eleventh path shows the message "Cannot add more than 10 paths!"
{% endhint %}

#### Test Results

Click the **Test** button at the bottom of the panel to run the block, then open the **Test Results** tab to see the output as **Raw**, **Pretty** or **Table**.

To see the result of every path together with the outputs of the nodes inside them, run the whole workflow with **Test Run** from the top-right corner of the editor. See Output of the Parallel Block for what the result looks like.

#### Settings

The **Settings** tab has one option, **Continue on error?**, which is off by default. It decides whether a failure on one path stops the whole workflow. See Error Handling for how it behaves.

<figure><img src="https://4290782554-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLg716fCfV8IUwXQygkTG%2Fuploads%2FbL8OBxiON3thBbrBIAws%2Fimage.png?alt=media&#x26;token=cf4e2190-6997-426d-a993-3e59d16ce67b" alt=""><figcaption></figcaption></figure>

#### Set Actions

Close the configuration panel to return to the workflow editor. Each path now has its own **+** button.

<figure><img src="https://4290782554-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLg716fCfV8IUwXQygkTG%2Fuploads%2Fl0Kq86vNgYCsao3z875Z%2Fimage.png?alt=media&#x26;token=08a8815e-8534-4aa4-89dc-61a1512c58e7" alt=""><figcaption></figcaption></figure>

* Click the **+** button on a path to add the nodes that should run on that path. A path can hold a chain of several nodes, and they run in order within that path.
* You can add Rule, Workflow, AI Agent, Code, REST API, database, Google Sheet and MS Excel nodes, as well as the **Set Variable**, **Switch**, **Loop** and **Parallel** control nodes. A Parallel Block can be nested inside another Parallel Block's path.
* **Wait & Resume**, **Sleep** and **Response** nodes are not available inside a path. Add them after **Parallel Done** instead.
* A path can also be left empty. It completes immediately and is reported as successful.
* Click the **+** button below **Parallel Done** to add the nodes that should run after all the paths have finished.

### Output of the Parallel Block

When all the paths have finished, the Parallel Block returns the status of each path, keyed by the path name:

```json
{
  "error": "",
  "output": {
    "CreditCheck": "success",
    "TierLookup": "success"
  }
}
```

The Parallel Block itself does not return the data produced on its paths. That data stays with the nodes that produced it, and every node inside a path is available as a token to the nodes after **Parallel Done**.

For example, suppose the **CreditCheck** path has a Code node named `CreditScore` that returns `720`, and the **TierLookup** path has a Code node named `CustomerTier` that returns `"gold"`. In a Response node after **Parallel Done**, you can use:

| Token                       | Value                                                 |
| --------------------------- | ----------------------------------------------------- |
| `{{.CreditScore.output}}`   | `720`                                                 |
| `{{.CustomerTier.output}}`  | `"gold"`                                              |
| `{{.ParallelBlock.output}}` | `{"CreditCheck": "success", "TierLookup": "success"}` |

In the token picker, open the source dropdown to filter tokens by node. Every node inside the paths is listed there, along with **ParallelBlock**.

{% hint style="warning" %}
Paths run at the same time, so a node on one path cannot use the output of a node on another path of the same Parallel Block. If a step needs another step's result, put both on the same path, or put the dependent step after **Parallel Done**.
{% endhint %}

### Error Handling

What happens when a node on one of the paths fails depends on the **Continue on error?** setting. On the canvas, a node that failed during a test run is marked with a red error badge, which makes it easy to spot the failing path.

#### Continue on error? is off (default)

The Parallel Block fails, the workflow stops, and the error names the path that failed:

```json
{
  "error": "1 error occurred while executing parallel node. TierLookup: Error: tier service down",
  "output": null
}
```

#### Continue on error? is on

The Parallel Block is still marked as failed and its `output` is `null`, but the workflow continues with the nodes after **Parallel Done**. The nodes on the paths that succeeded keep their outputs, so you can still use them further down the workflow.

### Deleting a Parallel Block

You can remove a single path from the block or delete the whole block.

#### Deleting a Path

1. **Open the Parallel Block:** Click the ParallelBlock node to open its configuration panel.
2. **Remove the Path:** In the **Input Params** tab, click the delete icon next to the path you want to remove.
3. **Save:** Click **Save**.

{% hint style="warning" %}
Removing a path also deletes **every node on that path**. No confirmation is shown, so check the path's nodes before you save.
{% endhint %}

#### Deleting the Whole Parallel Block

1. **Locate the Parallel Block Node:** Hover over the ParallelBlock node on the canvas. A toolbar with **Copy**, **Run** and **More** (⋮) icons appears to its left.
2. **Initiate Deletion:** Click **More** (⋮) and select **Delete**. The **Delete Parallel Node** popup opens.
3. **Choose an Option:**
   * **Delete All Branches**: Deletes the Parallel Block, all of its paths, and every node on those paths.
   * **Keep \<Path Name>** (one option for each path, for example **Keep CreditCheck**): Deletes the Parallel Block and all the other paths. The nodes on the kept path move into the main flow, between the node before the block and the node after **Parallel Done**, and run sequentially from then on. You can keep only one path.
4. **Confirm Your Action:** Click **Continue** to delete, or **Cancel** to keep the block as it is.

<figure><img src="https://4290782554-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLg716fCfV8IUwXQygkTG%2Fuploads%2F0YGNQeExLKWTQfBM0AfP%2Fimage.png?alt=media&#x26;token=76de80a9-abf3-419a-a9c1-92324ad8a5c9" alt=""><figcaption></figcaption></figure>

### Troubleshooting Guide

1. **Unable to Save the Block**
   * **Issue**: Clicking **Save** shows an error under a path name.
   * **Solution**: Fix the name using the path name rules: it must not be empty, must use only letters, numbers and underscores, and must be unique within the block.
2. **Workflow Stops at the Parallel Block**
   * **Issue**: The test run ends with "1 error occurred while executing parallel node".
   * **Solution**: The error message names the failing path. Open that path's nodes, find the one with the red error badge, and fix it. If the workflow should continue anyway, turn on **Continue on error?** in the block's **Settings** tab.
3. **Path Data Missing After Parallel Done**
   * **Issue**: `{{.ParallelBlock.output}}` only contains `success` values, not the data you expected.
   * **Solution**: The block returns the status of each path only. Reference the nodes inside the paths directly, for example `{{.CreditScore.output}}`.
4. **Node Not Available Inside a Path**
   * **Issue**: Response, Wait & Resume or Sleep is missing from the **Add Node** menu.
   * **Solution**: These nodes cannot run inside a path. Add them after **Parallel Done**.

### Conclusion

The Parallel Block lets you run independent steps at the same time instead of one after another, which shortens the total execution time of your workflow. Use it whenever your workflow makes several calls that don't depend on each other, such as fetching data from multiple APIs, databases or rules. Name up to 10 paths, add the actions each path should run, use their outputs in any node after **Parallel Done**, and let the **Continue on error?** setting decide whether one failed path should stop the whole workflow.
