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

# If-Else Node

> Add conditional logic and branching to your workflows

## Overview

The **If-Else Node** is your workflow's decision maker. It evaluates conditions and routes your flow down different paths based on whether those conditions are true or false. Perfect for user validation, permission checks, API response handling, and any scenario where your workflow needs to make smart decisions.

<img src="https://mintcdn.com/vibeflow/Vp9iYgMK68mQ5fXV/images/if-else-node.png?fit=max&auto=format&n=Vp9iYgMK68mQ5fXV&q=85&s=d2c605ac48010281ecdb63a5259f7f7d" alt="If-Else Node configuration showing conditions, operators, and logic mode" style={{ width: "100%", borderRadius: "8px", marginTop: "1rem", marginBottom: "2rem" }} width="1296" height="822" data-path="images/if-else-node.png" />

## Required Configuration

* **Label:** Display name for the node
* **Conditions:** The logic rules to evaluate (at least one required)
  * **Left Value:** What you're checking (from previous node or fixed value)
  * **Operator:** How to compare: equals, greater\_than, contains, empty, exists, etc.
  * **Right Value:** What to compare against (when applicable)
* **Logic Mode:** How to combine multiple conditions
  * **All:** Every condition must be true (AND logic)
  * **Any:** At least one condition must be true (OR logic)
  * **Custom:** Write your own logic like "(1 AND 2) OR 3"

## Optional Configuration

* **Requires Auth:** Whether this node needs user authentication (default: false)
* **Convert Types:** Auto-convert strings to numbers/booleans for comparison (default: true)

## Connections

If-Else nodes connect to any node type and create two output paths:

**Input from:** Frontend Elements, Query/Mutation nodes, Agent nodes, other If-Else nodes

**Output to:**

* **True branch:** When conditions pass
* **False branch:** When conditions fail

Can connect to any node type including:

* Query nodes (fetch data based on conditions)
* Mutation nodes (save different data per branch)
* Agent nodes (AI processing based on conditions)
* HTTP Request nodes (different API calls per branch)
* Email/Resend nodes (send notifications based on conditions)
* Return nodes (end workflow with different outputs)
* Edit Fields nodes (transform data differently per branch)
* Other If-Else nodes (nested conditional logic)

## Common Use Cases

**User Validation.** Age verification, email format checks, required field validation.

**Permission Routing.** Admin vs user flows, subscription tiers, feature flags.

**API Response Handling.** Success vs error responses, status code routing.

**Error Handling.** Network failures, invalid data recovery, user-friendly fallbacks.

### Example Workflows

* **Form Validation**: Frontend Form → If-Else (age ≥ 18) → True: Create Account / False: Show Error
* **User Permissions**: Login → If-Else (role = admin) → True: Admin Panel / False: User Dashboard
* **Data Validation**: API Call → If-Else (status = success) → True: Process Data / False: Show Error

## Related Nodes

<CardGroup cols={2}>
  <Card title="Frontend Element Node" icon="window" href="/nodes/frontend-element-node">
    Collect user input to evaluate
  </Card>

  <Card title="Query Node" icon="search" href="/nodes/query-node">
    Fetch data for condition checking
  </Card>

  <Card title="Agent Node" icon="robot" href="/nodes/agent-node">
    Use AI to make complex decisions
  </Card>

  <Card title="Mutation Node" icon="edit" href="/nodes/mutation-node">
    Store results from either branch
  </Card>

  <Card title="Edit Fields Node" icon="pen-ruler" href="/nodes/edit-fields-node">
    Transform data differently per branch
  </Card>

  <Card title="Email Node" icon="envelope" href="/nodes/email-node">
    Send notifications based on conditions
  </Card>
</CardGroup>
