# Condition

> Send the conversation down different paths depending on variables, answers, tags and the time.

Checks variables and takes the first branch whose conditions hold. It doesn't send anything and doesn't wait: the run goes straight on.



## Branches

A condition has one or more **branches**, checked from top to bottom; the first one that matches is taken. When none does, the run follows **Otherwise**. **Move up** and **Move down** change the order.

Each branch has a name (shown on its output) and one or more conditions, joined by **all conditions match** (and) or **any condition matches** (or). A branch with no conditions never matches.

## Conditions

A condition compares a **Variable** (a flow variable, or a built-in like `contact.tags` or `sys.weekday`) with a **Value**, which can itself contain variables.

| Comparison | True when |
| --- | --- |
| is / is not | The values are (not) equal. Text compares ignoring case and accents; numbers, yes/no and dates compare by value (`8` equals `8.0`). |
| contains | Text: the value appears in it. A list (such as `contact.tags`): one of its items is the value. |
| is greater than / is less than | Both sides are numbers, or both are dates, and the order holds. Otherwise false. |
| is set | The variable has a value (not empty). |
| matches pattern | The value is a regular expression that matches, ignoring case. |

A variable that was never set counts as empty: it equals only an empty value, and contains, is greater than, is less than and matches pattern are false for it.

## Outputs

| Output | When |
| --- | --- |
| One per branch | Its conditions hold, and no branch above it matched. |
| Otherwise | No branch matched. |

## Examples

| To | Branch condition |
| --- | --- |
| Send big groups to the team | `party_size` is greater than `7` |
| Treat customers already tagged VIP differently | `contact.tags` contains `vip` |
| Answer differently at weekends | `sys.weekday` is `sat`, **any condition matches** `sys.weekday` is `sun` |
| Skip a question you already have the answer to | `email` is set |
| Recognise an order number | `sys.input` matches pattern `^\d{6}$` |

> [!TIP]
> is greater than and is less than only compare numbers and dates, not times of day: `sys.time` is greater than `18:00` is never true. To act on opening hours, use a [Wait](https://nomongeta.zenhalab.com/www/nomongeta/en/docs/flow-builder/delay) step set to business hours.
