> For the complete documentation index, see [llms.txt](https://docs.waterflai.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.waterflai.ai/studio/studio-builders/flow-components-nodes/conditional-node.md).

# Conditional Node

### Overview

The Conditional Node enables you to create branching logic in your flows based on variable values. This node evaluates conditions in sequence and directs the flow through different paths depending on which condition is met first. It supports various data types and comparison operations, making it versatile for complex decision-making scenarios.

Usage cost: 1 credit

### Configuration Settings

#### Conditions

Each condition consists of:

* **Variable**: Select from available variables in your flow
* **Operator**: Choose a comparison operator based on the variable type
* **Value**: Enter the value to compare against (not required for empty/not empty checks)

#### Operator Types

Based on the variable type, different operators are available (contains, starts with, is, is not, is empty, equals, less than, ...

### Output Ports

The node provides multiple output ports:

* One port for each defined condition (IF/ELIF)
* One default port (ELSE) for when no conditions are met

#### Output Variables

* `result` (string): "true" if any condition matched, "false" if none matched
* `matched_condition_name` (string): Name of the matched condition or "Else case (default)"

### Best Practices

#### Condition Organization

1. **Order Matters**: Conditions are evaluated in sequence from top to bottom
2. **Default Case**: Always consider what should happen when no conditions are met (ELSE case)

#### Variable Selection

1. Choose variables that are guaranteed to be available when the node executes
2. Consider the variable type when planning your conditions
3. Ensure variable values will be in the expected format

#### Operator Usage

1. Use 'Is empty' and 'Is not empty' for null checks
2. For numerical comparisons, ensure values can be converted to numbers
3. When using string operations, consider case sensitivity

### Common Issues and Solutions

#### No Conditions Matching

**Problem**: Flow always goes to ELSE case **Solutions**:

* Verify variable values in debug mode
* Check condition order - first matching condition wins
* Ensure value comparisons match variable types

#### Type Mismatches

**Problem**: Conditions fail due to type mismatches **Solutions**:

* Verify variable types before comparison
* Use appropriate operators for the data type
* Convert values to correct type if needed

#### Performance Considerations

* Add conditions in order of likelihood to match (most common cases first)
* Use simple conditions when possible
* Avoid unnecessary complex string operations


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.waterflai.ai/studio/studio-builders/flow-components-nodes/conditional-node.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
