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

# Condition

> Branch your flow based on rules, expressions, and data comparisons

The **Condition** node evaluates one or more rules against the data in your flow and routes execution down different paths based on the result. Use it to add if/else logic, filter records, validate data, or create decision trees.

## When to Use It

* Routing a flow based on a form response (e.g., department = "Engineering" vs. "Sales")
* Checking an API response status before proceeding
* Validating data before writing to a table or sending an email
* Building approval workflows with different outcomes
* Filtering records that don't meet criteria

## How It Works

A Condition node has two outputs:

* **True path** — executes when the condition is met
* **False path** — executes when the condition is not met

Connect downstream nodes to either or both paths to control your flow's branching logic.

## Configuration

### Rules

Each rule compares a value from your flow against an expected value using an operator.

| Component | Description |
| - | - |
| **Field** | A template expression pointing to the data to evaluate |
| **Operator** | The comparison to perform |
| **Value** | The expected value to compare against |

### Operators

| Operator | Description | Example |
| - | - | - |
| **equals** | Exact match | `status` equals `active` |
| **not equals** | Does not match | `role` not equals `admin` |
| **contains** | String contains substring | `email` contains `@acme.com` |
| **not contains** | String does not contain substring | `name` not contains `test` |
| **greater than** | Numeric comparison | `amount` greater than `100` |
| **less than** | Numeric comparison | `score` less than `50` |
| **greater than or equal** | Numeric comparison | `age` greater than or equal `18` |
| **less than or equal** | Numeric comparison | `quantity` less than or equal `0` |
| **is empty** | Value is null, empty string, or undefined | `notes` is empty |
| **is not empty** | Value exists and is non-empty | `email` is not empty |
| **starts with** | String starts with prefix | `url` starts with `https` |
| **ends with** | String ends with suffix | `file` ends with `.pdf` |

### Multiple Rules

You can add multiple rules to a single Condition node. Choose how they combine:

| Mode | Behavior |
| - | - |
| **All (AND)** | Every rule must be true for the True path to fire |
| **Any (OR)** | At least one rule must be true for the True path to fire |

## Examples

> [accordion] Check API response status
>
> Route based on whether an API call succeeded:
>
> **Field:** `{{1_Request.status}}`
> **Operator:** equals
> **Value:** `200`
>
> * **True →** Process the response
> * **False →** Log the error / send alert

> [accordion] Route by form selection
>
> Send a form submission to different paths based on department:
>
> **Field:** `{{1_Form.form_data.department}}`
> **Operator:** equals
> **Value:** `Engineering`
>
> * **True →** Create a Jira ticket
> * **False →** Send an email to the general inbox

> [accordion] Validate required fields
>
> Check that all required data is present before proceeding:
>
> **Mode:** All (AND)
>
> | Field | Operator | Value |
> | - | - | - |
> | `{{1_Form.form_data.name}}` | is not empty | |
> | `{{1_Form.form_data.email}}` | contains | `@` |
>
> * **True →** Continue processing
> * **False →** Return a validation error

> [accordion] Threshold check
>
> Only trigger an alert if a value exceeds a threshold:
>
> **Field:** `{{1_Metrics.body.error_rate}}`
> **Operator:** greater than
> **Value:** `5`
>
> * **True →** Send a Slack alert
> * **False →** Do nothing (flow ends)

## Chaining Conditions

For complex decision trees, chain multiple Condition nodes together. Each branch can lead to another Condition, creating nested if/else logic:

```
Condition: Is VIP customer?
  ├── True → Condition: Order > $1000?
  │           ├── True → Priority fulfillment
  │           └── False → Standard fulfillment
  └── False → Condition: Has account?
              ├── True → Standard fulfillment
              └── False → Prompt to register
```

> [!TIP]
>
> Keep your conditions simple and descriptive. If you find yourself nesting more than 3 levels deep, consider using a Python node with more expressive logic instead.


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