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

# Branching

> Branch workflow execution paths based on earlier step results, with mandatory fallback paths and skipped branch tracking.

**If/Else conditional nodes** allow workflows to make autonomous routing decisions based on the outcome of previous steps, eliminating the need to pause for manual intervention when execution paths diverge.

An If/Else node evaluates results produced by earlier steps and routes the run down the branch whose condition matches. If no specific condition matches, execution falls back to a required default path.

> [!NOTE]
>
> **Prerequisite**: Ensure your repository is connected to a Revolte application. See [Workflow Overview](https://docs.revolte.ai/workflows/overview.md) to explore supported workflow types.

## Key capabilities

### Dynamic path selection

Route work down dedicated branches depending on earlier results. For example, after an automated check or test step, send runs down an approval branch when checks pass, or down a notification branch when checks fail.

### Mandatory default fallback

Every If/Else node requires a defined default path. When incoming data does not meet any explicit condition, the run executes the default path, ensuring workflows never stall in an undefined state.

### Explicit skipped path tracking

Branches not taken during a run are marked as `skipped` in the execution view. Reviewers can see both the executed route and the bypassed routes without ambiguity.

### Early condition validation

Revolte verifies branch conditions when you publish or run the workflow. Any syntax errors, unresolved field references, or broken conditions are surfaced before live execution starts.

***

## How execution routing works

```mermaid theme={"dark"}
flowchart TD
    A["Step 1: Agent or Action Step"] --> B{"If/Else Node"}
    B -->|"Condition A Matches"| C["Path A: Run Steps"]
    B -->|"Condition B Matches"| D["Path B: Run Steps"]
    B -->|"No Match (Fallback)"| E["Default Path: Run Steps"]
    C -.->|"Marked as Skipped"| D
```

1. **Prior Step Completes**: An earlier agent or action step produces an output object.
2. **Sequential Condition Evaluation**: The If/Else node evaluates its branch conditions in sequential order against that result.
3. **First-Match Execution**: The workflow follows the first condition that matches. If no branch condition matches, the workflow follows the required default path.
4. **Skipped Markers**: All paths not taken are marked and shown as skipped in the run summary.

> [!TIP]
>
> Pair If/Else nodes with [Structured Agent Output](https://docs.revolte.ai/workflows/structured-agent-output.md) to ensure agent outputs conform to expected schemas, giving conditional expressions reliable data fields to evaluate.

***

## Step-by-step workflow

**1. Open Workflow Configuration in Studio**

Navigate to **Studio** and open the workflow configuration where you want to add conditional branching.

**2. Add an If/Else Node**

Place an **If/Else** node immediately following the step whose result you want to evaluate.

**3. Define Branch Conditions**

Open the node configuration drawer and specify the condition expression for each branch path.

**4. Set the Required Default Path**

Designate one branch as the **Default** path to handle unexpected or unhandled result payloads.

**5. Publish and Test the Workflow**

Click **Publish** or **Run**. Review the live run summary to observe which branch executed and confirm that unchosen branches display as skipped.

***

## Current limitations & notes

* **Order of Evaluation**: Conditions evaluate in sequential order; the runtime follows the first matching path.
* **Default Path Requirement**: Every If/Else node must have exactly one active default branch before it can be published.
* **Skipped Visibility**: Skipped steps are recorded in run logs for auditability.
* TODO: confirm with engineering: The maximum number of conditional branches supported per If/Else node.
* TODO: confirm with engineering: Whether nested If/Else node hierarchies are supported.
* TODO: confirm with engineering: Complete list of supported comparison operators and field path syntax.

***

## Next steps

* [Structured Agent Output](https://docs.revolte.ai/workflows/structured-agent-output.md) — Standardize outputs so conditions evaluate predictable fields.
* [Standalone Code Review Agent](https://docs.revolte.ai/workflows/standalone-code-review.md) — Request on-demand code reviews on target branches.
* [Review Execution Plan](https://docs.revolte.ai/workflows/review-execution-plan.md) — Inspect agent execution plans before implementation begins.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.