Skip to main content
The Switch action evaluates multiple conditions and routes execution down the first matching path. Use it when you have more than two possible routes or need to match against specific values.

How it works

  1. Define multiple cases, each with a condition
  2. Cases are evaluated in order from top to bottom
  3. Execution continues down the first case that matches
  4. Add a case with {{true}} at the end to create a catch-all path

Configuration

Each case has:
PropertyDescription
ConditionAn expression that evaluates to true or false
NameOptional label for the case (for readability)

Writing case conditions

Matching specific values

Case 1: {{nodes.start.tier == "enterprise"}}
Case 2: {{nodes.start.tier == "professional"}}
Case 3: {{nodes.start.tier == "starter"}}
Case 4: {{true}}  ← Catch-all for unknown tiers

Range-based routing

Case 1: {{nodes.score.value >= 80}}   → Hot lead
Case 2: {{nodes.score.value >= 50}}   → Warm lead
Case 3: {{nodes.score.value >= 20}}   → Cool lead
Case 4: {{true}}                      → Cold lead

Complex conditions

Case 1: {{nodes.enrich.employees >= 1000 && nodes.enrich.funding > 50000000}}
Case 2: {{nodes.enrich.employees >= 100 && nodes.enrich.funding > 10000000}}
Case 3: {{nodes.enrich.employees >= 100}}
Case 4: {{true}}  → SMB path

Creating a catch-all path

Since cases are evaluated in order, you can create a catch-all by adding a final case with the condition {{true}}. This always matches, catching any records that didn’t match previous cases.
Case 1: {{nodes.start.source == "demo"}}     → Demo flow
Case 2: {{nodes.start.source == "trial"}}    → Trial flow
Case 3: {{nodes.start.source == "referral"}} → Referral flow
Case 4: {{true}}                             → General flow (catch-all)
Always add a {{true}} case at the end to handle unexpected values. Without it, records that don’t match any case may not be processed.

Common use cases

Lead tier routing

Route leads to different workflows based on their tier:
CaseConditionAction
1{{nodes.score.tier == "A"}}High-touch sales outreach
2{{nodes.score.tier == "B"}}Automated sequence + SDR
3{{nodes.score.tier == "C"}}Marketing nurture campaign
Catch-all{{true}}Add to general newsletter

Industry-specific handling

Customize workflows based on industry:
CaseConditionAction
1{{nodes.enrich.industry == "Technology"}}Tech-focused messaging
2{{nodes.enrich.industry == "Healthcare"}}Healthcare compliance flow
3{{nodes.enrich.industry == "Finance"}}Financial services flow
Catch-all{{true}}Generic messaging

Source-based routing

Handle leads differently based on their source:
CaseConditionAction
1{{nodes.start.source == "demo_request"}}Immediate sales contact
2{{nodes.start.source == "content"}}Content follow-up sequence
3{{nodes.start.source == "referral"}}Referral thank-you flow
Catch-all{{true}}Standard nurture

Score-based prioritization

Route by lead score ranges:
CaseConditionPriority
1{{nodes.score.value >= 90}}Immediate
2{{nodes.score.value >= 70}}Same day
3{{nodes.score.value >= 50}}Within week
Catch-all{{true}}Nurture

Case order matters

Cases are evaluated top to bottom, and the first match wins. Order your cases from most specific to least specific: Correct order:
Case 1: score >= 90  → Executes for 90+
Case 2: score >= 70  → Executes for 70-89
Case 3: score >= 50  → Executes for 50-69
Case 4: {{true}}     → Executes for < 50
Wrong order:
Case 1: score >= 50  → Executes for ALL 50+ (including 70+ and 90+!)
Case 2: score >= 70  → Never reached for 70+ leads
Case 3: score >= 90  → Never reached for 90+ leads
Case 4: {{true}}     → Executes for < 50
Always put more specific conditions before general ones. A score of 95 matches both >= 90 and >= 50, so the first matching case wins.

Switch vs. Branch

Choose the right action:
ScenarioUse
Yes/No decisionBranch
Two paths onlyBranch
Multiple specific valuesSwitch
More than two pathsSwitch
Range-based routingSwitch

Switch vs. Multiple Branches

You can chain multiple Branch nodes, but Switch is cleaner: Multiple Branches (harder to read): Single Switch (cleaner):
If you find yourself chaining more than two Branch nodes, consider using a Switch instead.

Best practices

Put specific conditions before general ones. For numeric ranges, start with the highest values first.
Give cases descriptive names like “Enterprise” or “Hot Lead” instead of leaving them as “Case 1”, “Case 2”.
Add a final case with {{true}} to handle unexpected values gracefully. This prevents records from falling through without being processed.
If you have more than 5-6 cases, consider whether the logic could be simplified or handled differently.
If conditions are complex, compute them in a Variables node first, then switch on simple values.

Example: Lead routing by segment

A workflow that routes leads to different teams based on company size and score: 1. Enrich → Get company data 2. Score → Calculate lead score 3. Switch: Route by segment
CaseConditionRoute to
Enterprise{{nodes.enrich.employees >= 1000 && nodes.score.value >= 60}}Enterprise AEs
Mid-Market{{nodes.enrich.employees >= 200 && nodes.score.value >= 50}}Mid-Market SDRs
High-Intent{{nodes.score.value >= 80}}Inbound team
SMB{{nodes.enrich.employees >= 20}}SMB automation
Catch-all{{true}}Nurture campaign
Each path then:
  • Allocates to the appropriate team
  • Creates CRM records with correct owner
  • Sends relevant notifications