---
title: Nesting, Branching, and Conditions
slug: nesting-branching-and-conditions
docTags: 
createdAt: 2025-08-11T11:13:45.000Z
---

The forEach loop functionality has been enhanced to provide with nesting capabilities, with multi-branching that enables on-success/error paths, and If/Else conditions.

Review how to set up the [Loop](#) native action before you nest, branch, and create conditions within loops.

## Nesting

As an orchestrator working with loops, you can add loops into another loop.

:::hint{type="info"}
You can only add four levels of *nested* loops (for a total of five). A warning dialog shows when you have reached the limit and cannot create more nested loops.
:::

Inside the loops, you can:

- Perform normal action functions, such as add, edit, and delete actions, inputs, and promote outputs
- Configure on success, on failure, and on complete action flow logic
- View and understand execution results from the branches of a loop and nested Loops
- Support IF/ELSE conditions

## Branching

As an orchestrator working with loops you can:

- Create one or more branches of actions and logic within a loop
- Perform normal action functions, such as add, edit, and delete actions, inputs, and promote outputs
- Configure on success, on failure, and on complete action flow logic
- View and understand execution results from the branches of a loop and nested Loops

## Conditions

Just like actions, you can create action [Flows and Conditions](#) for forEach loops.

:::hint{type="info"}
&#x20;Currently, in forEach loops, all conditions are **On Complete**.
:::

After adding an action, the action flow line displays.

1. Click the line to enable the condition functionality.

::Image[]{src="https://api.archbee.com/api/optimize/511c8QBH-VHiwWnyzIwUb/Fjsasuoym2ry4y5hBXgKe_loop-condition-window.png" size="76" width="1633" height="510" darkWidth="800" darkHeight="250" position="center" indent="2" showCaption="false"}

:::Paragraph{indent="1"}
The condition icon displays. Click to open the FLOW window.
:::

2. Click **Add Condition** to configure conditions for the action.
   The Edit Condition window opens.
3. Click **CREATE YOUR FIRST CONDITION** and the playbook property drawer opens, where you can select the desired property from the current action and preceding actions.
   - **Note:** The comparison operators differ based on the property selected.
4. Configure the condition. Conditions are visible in the FLOW window.

## Use Case

See the [Nesting, Branching, and Conditions use case](#) for example.
