Workflows
Blocks
Logic
Switch

Switch Block

What it does: Routes your workflow to one of several branches based on a single value.

🔀

In simple terms: Like a traffic roundabout — one road in, many roads out. The value you're checking determines which exit to take.

When to Use This

Use Switch instead of multiple Condition blocks when you need to fan out on a single value:

  • ✅ Route by category: order_issue → Support, return_request → Returns, product_question → Sales
  • ✅ Route by lead score: Hot → Fast-track, Warm → Nurture, Cold → Newsletter
  • ✅ Route by language: en → English flow, es → Spanish flow, fr → French flow
  • ✅ Route by plan tier: free → Upsell flow, pro → Feature flow, enterprise → CSM flow

Switch vs Condition: Use Condition when your decision depends on comparisons (>, <, contains). Use Switch when you're matching one variable against a fixed list of known values — it's cleaner and easier to read.

How It Works

Switch Block
  1. Pick the variable (or write a custom expression) you want to check
  2. Add cases — each case has a match value and routes to its own branch
  3. Optionally keep the Default branch to catch anything that doesn't match

Configuration

Step 1 — What to switch on?

Choose one:

OptionExampleUse when
VariableSelect queryCategory from the dropdownYou stored the value in a workflow variable
Custom expression{{leadScore}} or {{order.status}}You want to reference a nested field or combine values

Selecting a variable clears the expression, and vice versa — they're mutually exclusive.

Step 2 — Cases

Each case defines one routing branch:

FieldRequiredDescription
Match valueYesThe exact string the switch value must equal to activate this branch
Branch labelNoDisplay name shown on the workflow canvas (e.g. "Hot Lead")
⚠️

Match values are compared as strings. "10" and 10 are treated the same only when Case-Sensitive Matching is off. Numbers from API responses are usually already strings in workflow variables.

Options

OptionDefaultDescription
Include Default BranchOnCatches any value that doesn't match any case. Disable if all possible values are covered.
Case-Sensitive MatchingOffOff: "hot" matches "Hot". On: must match exactly including case.

Example: Support Query Router

Variable: {{queryCategory}}

Cases:
  1. "order_issue"     → label: "Order Issue"    → [Order Support flow]
  2. "return_request"  → label: "Return Request"  → [Returns flow]
  3. "product_question"→ label: "Product Info"    → [Sales flow]

Default → [General Support flow]

Tips

  • Order doesn't matter — only the first matching case fires (and only one can match).
  • Case labels are purely cosmetic — they appear on the node edge on the canvas. Use them to make the graph readable.
  • Leave Default on unless you're 100% sure your switch value will always match one of your cases — unexpected values silently skip the block otherwise.
  • For complex matching (regex, ranges, contains), use a Condition block instead.
Indite Documentation v1.6.0
PrivacyTermsSupport