Conditions and branching
A condition routes the flow down one of two paths based on the data passing through it. Each condition has a true output and a false output; connect a different branch of nodes to each. Add one by clicking + on an edge and selecting Condition.
Conditions pass their incoming payload through unchanged—they only decide which path the flow takes. For field-level detail, see the Reference.
Condition types
| Condition | How it decides |
|---|---|
| Expression | Evaluates a boolean expression you build from comparisons. Routes to true when the expression is true. |
| Script | Runs a script that returns a value; routes to true when the value is truthy. The script can read the incoming payload and your mapped input. It runs in the same sandbox, under the same limits, as the Script action. |
| Random (A/B Split) | Routes to true for a percentage of runs that you set, and to false for the rest—useful for A/B tests. |
| AI Judgment | Asks an AI agent a yes/no question about the data passing through—"Is this on-brand?"—and routes to true on yes. The agent can call tools from MCP servers to inform its answer, but is only ever offered read-only tools, so deciding a route never changes anything. See AI and agents. |
Building an expression
The Expression condition is built from a tree of comparisons. The leaves compare values; the branches combine them.
Comparisons test one or two values, each of which can be a variable or a literal:
- Two-value operators: Equals (
==), Not Equals (!=), Greater Than (>), Less Than (<), Greater Or Equal (>=), Less Or Equal (<=), Contains, and Matches Regex. - One-value operators: Is Empty, Is Not Empty, Is Truthy, and Is Not Truthy.
Combinators group comparisons:
- All Of—true only when every condition inside it is true (AND).
- Any Of—true when any condition inside it is true (OR).
- Not—inverts the condition inside it.
Because All Of, Any Of, and Not can contain other comparisons and combinators, you can express logic of any depth—for example, "status equals published And (section equals news Or section equals sports)." The editor shows a readable preview of the expression as you build it.