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
| Parameter | Description | Required |
|---|---|---|
| Branches | Named outputs with conditions | Yes |
| Convert Types | Auto-convert values before comparison | No |
| Ignore Case | Case-insensitive string comparisons | No |
Branches
Each branch defines:
| Property | Description |
|---|---|
| Name | Output name for this branch |
| Conditions | List of conditions for this branch |
| Combine Operation | AND/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":
statusEqualsactive - Branch "pending":
statusEqualspending - Branch "archived":
statusEqualsarchived
┌─ active ──→ [Process Active]
[Switch] ────┼─ pending ─→ [Process Pending]
├─ archived → [Process Archived]
└─ other ───→ [Handle Unknown]
Route by Amount Range
Tiered processing:
Branches:
- Branch "premium":
amountGreater Than1000 - Branch "standard":
amountGreater Than100 - Branch "basic": (no conditions - catches rest)
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":
categoryEqualselectronics - Branch "clothing":
categoryEqualsclothing - Branch "food":
categoryEqualsfood
Items not matching any category go to "other".
Complex Branch Conditions
Each branch can have multiple conditions:
Branch "vip":
- Combine: AND
- Condition 1:
totalSpentGreater Than5000 - Condition 2:
memberYearsGreater Than2
Branch "new_high_value":
- Combine: AND
- Condition 1:
totalSpentGreater Than1000 - Condition 2:
memberYearsLess Than Or Equal1
Region-Based Routing
Route by region with fallback:
Branches:
- Branch "north_america":
regionContainsUSORregionContainsCA - Branch "europe":
regionContainsEUORregionContainsUK - Branch "asia_pacific":
regionContainsAUORregionContainsJP
Unmatched regions go to "other" for manual review.
Switch vs Multiple If Nodes
| Use Switch when... | Use If nodes when... |
|---|---|
| Multiple mutually exclusive paths | Simple true/false branching |
| Named output branches needed | Only two outcomes |
| Centralized routing logic | Complex nested conditions |
| Items can match multiple branches | Strict 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