# Condition (/docs/nodes/condition)



The **Condition** node asks one yes/no question and sends the run down one of two paths. It is the simplest way to make a flow decide something.

## When to use it [#when-to-use-it]

* Split the flow on a rule such as `amount > 1000` or `country in ["DO", "US"]`.
* Act on a value computed earlier: a score, a ratio, a flag or the confidence of an AI answer.
* Need more than two outcomes? Use a [Switch](/docs/nodes/switch) instead.

## How it works [#how-it-works]

<Diagram node="condition" kind="anatomy" />

1. The expression is evaluated against the payload and the variables written so far.
2. If the result is truthy, the run continues through **True**; otherwise through **False**.
3. The trace records which way it went and why: the actual value next to what was expected.

## Ports [#ports]

| Port    | Taken when                                  |
| ------- | ------------------------------------------- |
| `True`  | The expression evaluated to a truthy value. |
| `False` | It did not.                                 |

## Configuration [#configuration]

| Field       | What it does                                                                    |
| ----------- | ------------------------------------------------------------------------------- |
| Name        | Label shown on the canvas and in the trace.                                     |
| Expression  | The rule, written as a formula in the editor. Stored as a JSONLogic tree.       |
| Description | Plain-language explanation of the rule. It appears as the summary in the trace. |

## What it writes [#what-it-writes]

No variables. The trace entry carries `matched`, the `actual` value and what was `expected`, which is what makes a branch explainable after the fact.

## In a real flow [#in-a-real-flow]

<Diagram node="condition" kind="example" />

Large amounts are routed to a manual review; everything else goes straight to the output. Both paths meet again at the Output node.

## When it fails [#when-it-fails]

* The expression cannot be evaluated: the run fails with `EXPRESSION_FAILED`.
* An empty expression is an error in the Checks panel and blocks publishing.

## Good to know [#good-to-know]

* Each port can connect to one node. To send both outcomes to the same place, connect each port to it.
* A port with no connection ends the run there, and the Checks panel warns you.

## Related [#related]

* [Switch](/docs/nodes/switch)
* [Expressions](/docs/concepts/expressions)
* [Trace](/docs/concepts/trace)
