Skip to main content

Multi-Condition Node

The Switch node routes workflow execution to one of multiple paths based on matching conditions. Use it when you have more than two possible routes, such as categorizing items, routing to departments, or handling multiple statuses.

When to Use

  • Multiple categories - Route based on type, category, or classification
  • Status handling - Different actions for different statuses
  • Department routing - Send to Sales, Support, Billing, etc.
  • Multi-language - Route based on detected language
  • Tiered responses - Different handling for different levels
Use Switch instead of nested Conditions when you have 3+ possible paths. It’s cleaner and shows all options at once.

Example: Email Routing

Route support emails to different teams:
1

Classify the email

Use an LLM node to categorize the email:
Categorize this support email into exactly one category:
BILLING, TECHNICAL, SALES, GENERAL

Subject: {{event_from_app_1.email.subject}}
Body: {{event_from_app_1.email.body}}

Respond with only the category name.
2

Configure the Switch

Add a Switch node:
  • Mode: value
  • Variable: {{llm_1.response}}
  • Cases:
    • BILLING
    • TECHNICAL
    • SALES
    • GENERAL
  • Default: enabled
3

Connect each case

Connect each handle to the appropriate action:
  • BILLING → Slack #billing-support
  • TECHNICAL → Slack #tech-support
  • SALES → Slack #sales-team
  • GENERAL → Slack #general-support
  • default → Slack #triage (for unexpected categories)

Example: Order Status Handler

Different actions based on order status:
├── Webhook (order status update)
├── Switch (based on {{webhook_1.body.status}})
│   ├── pending → External API (send confirmation email)
│   ├── processing → External API (update inventory system)
│   ├── shipped → External API (send tracking email)
│   ├── delivered → External API (request review)
│   ├── cancelled → Execute Code (process refund)
│   └── default → External API (Slack: unknown status alert)

Example: Language-Based Routing

Route to native speakers:
├── Event from App (new chat message)
├── LLM (detect language: EN, ES, FR, DE, other)
├── Switch (based on detected language)
│   ├── EN → Call Agent (English Support Agent)
│   ├── ES → Call Agent (Spanish Support Agent)
│   ├── FR → Call Agent (French Support Agent)
│   ├── DE → Call Agent (German Support Agent)
│   └── default → Human (manual language assignment)

Switch Modes

Value Mode

Compare a single variable against multiple values: Configuration:
{
  "mode": "value",
  "switchVariable": "{{llm_1.response.priority}}",
  "cases": [
    {"name": "Critical", "value": "P1"},
    {"name": "High", "value": "P2"},
    {"name": "Medium", "value": "P3"},
    {"name": "Low", "value": "P4"}
  ]
}
Each case checks: {{llm_1.response.priority}} == "P1", etc.

Conditions Mode

Each case has its own independent condition: Configuration:
{
  "mode": "conditions",
  "cases": [
    {
      "name": "VIP Customer",
      "condition": "{{customer.tier}} == 'enterprise' AND {{customer.lifetime_value}} > 100000"
    },
    {
      "name": "At Risk",
      "condition": "{{customer.last_activity_days}} > 90 OR {{customer.support_tickets}} > 10"
    },
    {
      "name": "New Customer",
      "condition": "{{customer.created_days}} < 30"
    },
    {
      "name": "Standard",
      "condition": "true"
    }
  ]
}
In conditions mode, cases are evaluated in order. The first matching condition wins. Use a true condition last as a catch-all.

Default Case

The default case handles values that don’t match any defined case:
├── Switch (order type)
│   ├── subscription → Handle subscription
│   ├── one-time → Handle one-time
│   ├── trial → Handle trial
│   └── default → Log unknown type, alert team
Always enable the default case unless you’re certain all possible values are covered. Unmatched values with no default will cause the workflow to stop.

Case Naming

Give cases descriptive names that appear on the workflow canvas:
Good:
- "Enterprise Customer"
- "Needs Approval"
- "Auto-Processed"

Bad:
- "Case 1"
- "Option A"
- "True"

Combining with Merge

If branches need to rejoin:
├── Switch (customer tier)
│   ├── enterprise → Premium processing
│   ├── business → Standard processing
│   └── free → Basic processing
├── Merge (wait for whichever branch executed)
└── External API (log completion)

Dynamic Case Values

Reference variables in case values:
{
  "mode": "value",
  "switchVariable": "{{webhook_1.body.action}}",
  "cases": [
    {"name": "Create", "value": "CREATE"},
    {"name": "Update", "value": "UPDATE"},
    {"name": "Delete", "value": "DELETE"}
  ]
}

Tips

Use the LLM node before Switch to classify free-text into known categories. Then Switch routes based on the LLM’s structured output.
Order matters in conditions mode - put more specific conditions first, general catch-alls last.
You don’t need to connect every case. Some cases might intentionally do nothing (the branch just ends).

Condition vs. Switch

ScenarioUse
Yes/no decisionCondition
2 optionsCondition
3+ optionsSwitch
Comparing one variable to multiple valuesSwitch (value mode)
Multiple independent conditionsSwitch (conditions mode)

Settings

name
string
default:"Switch"
Display name shown on the canvas.
key
string
default:"switch_1"
Unique identifier for referencing outputs.
mode
string
default:"value"
How to evaluate cases:
  • value - Compare a variable against specific values
  • conditions - Each case has its own condition expression
switchVariable
string
For value mode: the variable to compare (e.g., {{llm_1.response.category}}).
cases
array
Array of cases, each with:
  • name - Label for this case
  • value - Value to match (value mode)
  • condition - Expression to evaluate (conditions mode)
defaultCase
boolean
default:"true"
Whether to include a default case for unmatched values.

Outputs

The Switch node has multiple output handles:
  • One handle per case - Named after the case (e.g., “Sales”, “Support”)
  • default - Executes when no cases match (if enabled)
matchedCase
string
The name of the case that matched.
matchedValue
any
The value that triggered the match.