Skip to main content

Switch

Routes items to multiple branches based on conditions.

Overview​

The Switch node evaluates multiple condition sets and routes items to matching branches. Unlike If (which has two outputs), Switch supports any number of named outputs. Use it to:

  • Route to multiple destinations
  • Implement multi-way branching
  • Handle multiple cases in one node

Parameters​

ParameterDescriptionRequired
BranchesNamed outputs with conditionsYes
Convert TypesAuto-convert values before comparisonNo
Ignore CaseCase-insensitive string comparisonsNo

Branches​

Each branch defines:

PropertyDescription
NameOutput name for this branch
ConditionsList of conditions for this branch
Combine OperationAND/OR for this branch's conditions

Outputs​

  • One output per defined branch (using branch names)
  • other - Items that didn't match any branch

Multi-Match Behavior​

Items can match multiple branches. When an item matches multiple branches, it's sent to all matching outputs.

To ensure single-output routing, design conditions to be mutually exclusive.

Examples​

Route by Status​

Route items to status-specific processors:

Branches:

  • Branch "active": status Equals active
  • Branch "pending": status Equals pending
  • Branch "archived": status Equals archived
              ┌─ active ──→ [Process Active]
[Switch] ────┼─ pending ─→ [Process Pending]
├─ archived → [Process Archived]
└─ other ───→ [Handle Unknown]

Route by Amount Range​

Tiered processing:

Branches:

  • Branch "premium": amount Greater Than 1000
  • Branch "standard": amount Greater Than 100
  • Branch "basic": (no conditions - catches rest)
Order Matters

An item with amount 1500 matches both "premium" and "standard". Design conditions carefully or expect multi-routing.

Route by Category​

Multiple category outputs:

Branches:

  • Branch "electronics": category Equals electronics
  • Branch "clothing": category Equals clothing
  • Branch "food": category Equals food

Items not matching any category go to "other".

Complex Branch Conditions​

Each branch can have multiple conditions:

Branch "vip":

  • Combine: AND
  • Condition 1: totalSpent Greater Than 5000
  • Condition 2: memberYears Greater Than 2

Branch "new_high_value":

  • Combine: AND
  • Condition 1: totalSpent Greater Than 1000
  • Condition 2: memberYears Less Than Or Equal 1

Region-Based Routing​

Route by region with fallback:

Branches:

  • Branch "north_america": region Contains US OR region Contains CA
  • Branch "europe": region Contains EU OR region Contains UK
  • Branch "asia_pacific": region Contains AU OR region Contains JP

Unmatched regions go to "other" for manual review.

Switch vs Multiple If Nodes​

Use Switch when...Use If nodes when...
Multiple mutually exclusive pathsSimple true/false branching
Named output branches neededOnly two outcomes
Centralized routing logicComplex nested conditions
Items can match multiple branchesStrict single-path routing

Tips​

  • Branch names become output handles
  • "other" output catches unmatched items
  • Items can match multiple branches (sent to all matching)
  • Order branches by priority if using overlapping conditions
  • Use Convert Types for string/number comparisons
  • Connect the "other" output to handle edge cases
  • Convert Types defaults to true
  • Ignore Case defaults to true