# Workflow expressions and variables

Expressions provide typed decisions for Workflow edges and Structured Procedure If steps. The expression root used as a condition must evaluate to a boolean.

## Values and operators

Available values are boolean, number, text, `null`, dynamic variable, and LLM value. Arithmetic operators are add, subtract, multiply, and divide. Comparisons are equals, not equal, greater than, greater or equal, less than, and less or equal. Logical And and Or short-circuit, and If/then/else evaluates only the selected branch.

There is no coercion. Arithmetic accepts numbers, ordered comparisons accept matching numbers or matching strings, and boolean is not treated as the number 1. Integer and decimal numbers can compare numerically. Division by zero and incompatible types fail the Workflow instead of guessing.

## Dynamic variables

A dynamic-variable node reads a value produced by a webhook Tool assignment. A missing variable evaluates to `null`; it does not become false, zero, or an empty string. Compare explicitly with `null` or another typed value when absence changes routing. See [Tool dynamic variables](/docs/tools/dynamic-variables) for assignment rules.

## LLM values and limits

An LLM value can request boolean, text, integer, or number output and may allow `null`. Text values can define an allowed enum. The provider result must match that schema exactly. A legacy LLM condition without a schema produces a boolean.

Expression validation allows a maximum depth of 20 and at most 100 AST nodes in the authored expression tree. Runtime enforces the same typed boundaries independently. Test every error branch and inspect `workflow_error` under **[Activity](/docs/monitor/transcript-and-activity)** when a value or operator is invalid.

Continue with [edge ordering](/docs/workflows/edges-and-conditions) or [Subagent and Tool nodes](/docs/workflows/subagents-and-tools).
