The Condition block checks branches in order and follows the first true expression. It makes no model call. Use a Router when the decision depends on understanding intent or unstructured text.
Route by priority
Check <start.priority> === 'high' in the if branch. Connect that port to escalation and else to a standard reply.
Configuration
Conditions contains an if branch, optional else if branches, and else. Each expression uses JavaScript operators and methods and connects to its own path. Put specific checks before general ones: the first match wins.
<agent.score> > 75
<ticket.subject>.toLowerCase().includes('urgent')
<user.email>.endsWith('@company.com') && <user.plan> === 'pro'Comparisons, logical operators, string/array methods, math, and Date comparisons work in expressions. Move lengthy logic to a Function and branch on its result.
Environment variables use {{KEY}}:
{{MAX_RETRIES}} === 3
{{FEATURE_ON}} === true
{{TIER}} === 'pro'Numbers, booleans, and null compare as literals here. Other environment values are bound as strings, so quotes or newlines inside a secret cannot become expression code. This differs from Function placeholders, which always remain strings.
Outputs
Only the chosen path runs. A reference to a known block on a skipped path has no output.
Errors and unmatched input
Connect else to handle input that matches no expression. An unconnected else path ends without an error. A final true expression is another catch-all when you deliberately omit else.
An expression that throws fails the block. Guard missing values with optional chaining (?.) or a null check, and connect the error port when the workflow should recover.
Gate on a model score
Give the Agent a Response Format containing numeric toxicity, then check <moderate.toxicity> > 0.7. The high-score branch blocks the content; else sends it to the publishing endpoint. The same pattern can route accounts by a structured tier field.
