---
title: "Route Flow"
url: "https://help.flows.world/en/article/route-flow"
language: "en"
last_updated: "2026-09-19T07:03:40.996Z"
---

# Route Flow

## Overview

The Route Flow stage evaluates conditions and directs your workflow down different paths based on whether the conditions are true or false. Use it to make decisions, implement business logic, validate data, and create branching workflows.

![](https://cdn-assets.productfruits.com/b0acd117-fc34-48cb-9813-e70852f8d5c4)

## Configuration

### Required Fields

| Field | Description | Example |
| --- | --- | --- |
| **Field 1** | First value to compare (often a variable) | **{{****Amount****}},** **{{****PreviousBalance****}}** |
| **Comparator** | Comparison operation to perform | Equal, GreaterThan, Contains, etc. |
| **Field 2** | Second value to compare against | `1000`, `verified`, **{{****FinalBalance****}}** |

### Optional Fields

-   **Operator:** How to combine multiple conditions
    -   `AND`: All conditions must be true for Pass (default)
    -   `OR`: Any condition being true triggers Pass   
        ![](https://cdn-assets.productfruits.com/d8f6780a-8c83-401b-9190-616fd70d4e33)
-   **Filter Groups:** Nest conditions for complex logic like `(A AND B) OR (C AND D)`

![](https://cdn-assets.productfruits.com/8a6b89e0-d920-4197-a934-23ea8f0b85de)

## Comparators

### String Comparators

| Comparator | Description | Example |
| --- | --- | --- |
| **Equal** | Field 1 exactly equals Field 2 | **{{****status****}}** equals `active` |
| **NotEqual** | Field 1 does not equal Field 2 | **{{****status****}}** not equal `pending` |
| **Contains** | Field 1 contains Field 2 as substring | **{{****email****}}** contains `@company.com` |
| **DoesNotContain** | Field 1 does not contain Field 2 | **{{****message****}}** does not contain `error` |
| **StartsWith** | Field 1 starts with Field 2 | **{{****message****}}** starts with `+1` |
| **EndsWith** | Field 1 ends with Field 2 | **{{****file****}}** ends with `.pdf` |
| **IsInCSV** | Field 1 matches a value in comma-separated Field 2 | **{{****message****}}** in `admin,manager,supervisor` |
| **IsNotInCSV** | Field 1 not in comma-separated Field 2 | **{{****message****}}** not in `guest,viewer` |

### Numeric Comparators

| Comparator | Description | Example |
| --- | --- | --- |
| **Equal** | Field 1 == Field 2 | **{{****Amount****}}** equals `10` |
| **NotEqual** | Field 1 != Field 2 | **{{****Amount****}}** not equal `0` |
| **GreaterThan** | Field 1 > Field 2 | **{{****order****}}** > `1000` |
| **GreaterThanEqual** | Field 1 ≥ Field 2 | **{{****age****}}** ≥ `18` |
| **LessThan** | Field 1 < Field 2 | **{{****price****}}** < `100` |
| **LessThanEqual** | Field 1 ≤ Field 2 | **{{****price****}}** ≤ `50` |

## Exit Points

| Exit | When |
| --- | --- |
| **Pass** | All conditions true (AND) or at least one condition true (OR) |
| **Fail** | Conditions evaluated to false |

**Note:** This stage has NO Error exit. Invalid comparators return false and route to Fail.

## How It Works

When executed, the stage:

1.  **Resolves Values** - Processes Field 1 and Field 2 from variables
2.  **Performs Comparisons** - Evaluates each condition based on comparator
3.  **Combines Results** - Applies AND/OR logic:
    -   **AND:** Short-circuits on first false, all must be true for Pass
    -   **OR:** Short-circuits on first true, any true triggers Pass
4.  **Routes to Exit** - Pass if true, Fail if false

## Common Use Cases

### 1\. Simple Value Check

-   **Field 1:** **{{****Amount****}}**
-   **Comparator:** GreaterThan
-   **Field 2:** `1000`
-   **Pass:** High-value orders to premium processing
-   **Fail:** Standard processing   
    ![](https://cdn-assets.productfruits.com/715bfeda-4018-45b5-ad2c-dab8df6ad327)

### 2\. Multiple Conditions (AND)

-   **Operator:** AND
-   **Condition 1:** **{{****customerStatus****}}** equals `verified`
-   **Condition 2:** **{{****isRegistration****}}** equals `confirmed`
-   **Pass:** Both true, approve order
-   **Fail:** Either false, hold for review

### 3\. Multiple Conditions (OR)

-   **Operator:** OR
-   **Condition 1:** **{{****Priority****}}** equals `urgent`
-   **Condition 2:** **{{****DepositAmount****}}** greater than `5000`
-   **Pass:** Either urgent OR high-value, send notification
-   **Fail:** Neither condition true

### 4\. Range Check

-   **Operator:** AND
-   **Condition 1:** **{{****DepositAmount****}}** ≥ `100`
-   **Condition 2:** **{{****DepositAmount****}}** ≤ `500`
-   **Pass:** Order in range $100-$500, apply discount
-   **Fail:** Outside range

## Key Behaviours

| Feature | Behaviour |
| --- | --- |
| **Case Sensitivity** | String comparisons are case-sensitive (`Admin` ≠ `admin`) |
| **Short-Circuit** | AND stops at first false, OR stops at first true (performance optimization) |
| **Whitespace** | IsInCSV removes spaces around commas, other comparators preserve whitespace |
| **Nested Logic** | ✓ Supports complex conditions via filter groups |
| **No Error Exit** | Invalid comparators return false, route to Fail (not Error) |

## Troubleshooting

| Issue | Common Cause | Fix |
| --- | --- | --- |
| Always routes to Fail | Wrong comparator or operator | Verify comparator type and AND/OR logic |
| Case mismatch | Comparing "Admin" to "admin" | Normalize case with Change Data first |
| Whitespace issues | "hello " doesn't equal "hello" | Trim values before comparison |
| Wrong data type | String "100" vs number 100 | Set filter type to STRING\_DATA or DOUBLE\_DATA correctly |
| Inverted logic | Expected Pass got Fail | Check comparator and field order |

## Best Practices

-   ✓ Use descriptive stage names (e.g., "Check Order Value")
-   ✓ Keep conditions simple - avoid deeply nested logic
-   ✓ Connect both Pass and Fail exits
-   ✓ Test boundary values and edge cases
-   ✓ Use variables for flexibility instead of hardcoded values
-   ✓ Document complex business rules
-   ✓ Normalize data (case, whitespace) before comparison
-   ✓ Remember AND = all conditions, OR = any condition

## Common Mistakes

| Mistake | Symptom | Fix |
| --- | --- | --- |
| Wrong operator (AND vs OR) | Unexpected routing | Remember AND = all must be true, OR = any can be true |
| Not connecting Fail exit | Workflow breaks when false | Always connect both exits |
| Comparing wrong data types | Always routes to Fail | Match filter type (STRING/DOUBLE) to data |
| Missing variable | Comparison fails | Ensure variables exist before Route Flow |
| Overly complex conditions | Hard to debug | Break into multiple Route Flow stages |

## Related Stages

-   [**Loop**](https://help.flows.world/en/article/loop)**:** Use Route Flow inside loops for conditional processing
-   [**Change Data**](https://help.flows.world/en/article/change-data)**:** Prepare data before routing decisions
-   [**Fetch Data**](https://help.flows.world/en/article/fetch-data)**:** Retrieve data needed for routing decisions
-   [**Call API**](https://help.flows.world/en/article/call-api)**:** Route based on API response values
-   [**Set Default Value**](https://help.flows.world/en/article/set-default-value)**:** Ensure variables have values before comparison
