Skip to content

If node ​

The If node splits a flow in two. It evaluates a condition and sends the flow down either the true port or the false port — the basic building block for "do this, otherwise do that".

Component id: flowrunner/if.

Two ways to write the condition ​

If supports two condition formats. If a structured expression is present it wins; otherwise the engine falls back to a text condition.

Structured expression (expression) ​

A structured expression is the format the visual condition builder produces. It's a tree of comparisons combined with and / or groups. Each comparison has a left operand, an operator, and (for most operators) a right operand. Operands are either a reference (variable.field) or a literal.

Supported operators:

OperatorMeaningRight side
== / !=equal / not equalrequired
> < >= <=numeric comparisonrequired
containsleft string contains right stringrequired
startsWith / endsWithstring prefix / suffixrequired
truthyleft value is truthynone
falsyleft value is falsynone

Groups combine children: an and group is true when every child is true; an or group is true when any child is true. An empty group evaluates to true.

Text condition (condition) ​

When no structured expression is set, the engine reads the condition string and runs a small, deliberately-limited evaluator. It supports a single comparison — no &&, ||, parentheses, or function calls:

text
start.age >= 18
response.status == 200
start.role != "admin"
result.count            # bare ref → truthy check

Both sides may be references or literals. Literals are numbers, "quoted strings", true, false, or null. A dotted token like start.age reads from refs; a bare token is treated as a namespace lookup.

Config ​

FieldRequiredDescription
expressionNoStructured condition tree (kind: 'group' | 'cmp'). Used when present.
conditionNoText condition string. Used as the fallback when there is no structured expression.

Ports ​

PortFollowed when
trueThe condition evaluated to true.
falseThe condition evaluated to false.

If evaluating the condition throws an error, the flow goes down false — unless you have wired an error port, in which case the failure routes there instead.

Example ​

Route paying customers differently from free users:

text
If  condition: start.plan == "pro"
  true  → grant premium access
  false → show upgrade prompt

TIP

For anything more complex than one comparison — multiple conditions combined with and/or — use the structured expression builder rather than the text condition, which only handles a single comparison.

See also ​

FlowRunner — the no-code platform for small businesses.