Condition Node

Branch your workflow with if, else if, and else expressions.

The Condition node splits your workflow into branches based on expressions. Only the matching branch executes.

How it works

         ┌─ (if true)  → Branch A
Start → Condition ─┤
         └─ (else)     → Branch B

Each branch has its own output handle on the Condition node. Connect downstream nodes to the appropriate handle.

Configuring conditions

Conditions are evaluated top to bottom:

TypeBehavior
IfFirst condition — executes its branch when the expression is truthy
Else IfChecked in order when previous conditions were false
ElseRuns when all previous conditions were false (always truthy)

Writing expressions

Expressions are JavaScript that evaluate to true or false:

lastOutput.status === 'approved'
lastOutput.amount > 1000
lastOutput.items && lastOutput.items.length > 0
inputs.priority === 'urgent'

Use the Variables button to insert data paths instead of typing them manually.

Multiple branches

Add Else If conditions for multi-way branching:

If:      lastOutput.score >= 90   → "Excellent" path
Else If: lastOutput.score >= 70   → "Good" path
Else If: lastOutput.score >= 50   → "Average" path
Else:                              → "Needs improvement" path

Example — route by sentiment

After an AI node classifies feedback:

If:      lastOutput.sentiment === 'negative'  → Send alert to Slack
Else If: lastOutput.sentiment === 'positive'  → Post thank-you email
Else:                                         → Log for review

Tips

  • Keep expressions simple — complex logic belongs in a Function node upstream.
  • Always include an Else branch as a fallback unless you're certain one path will match.
  • Test each branch with manual runs using different input data.
  • Check the Execution Data tab to see which branch was taken.