# Switch Case

Match expression against cases and return corresponding response.

## Plan availability

| Feature | Free | Starter | Pro | Enterprise |
| --- | --- | --- | --- | --- |
| Active workflows | 3 | 10 | 45 | Unlimited |

Allowances follow the [published Chatigram pricing page](https://chatigram.com/pricing/). Your organization’s Billing & Plans screen confirms its subscription and current usage. Plans can change. Plan information reviewed 2026-11-10.


## When to use this node

Match expression against cases and return corresponding response.

Add **Switch Case** to a workflow branch using the node picker. Configure its fields in the inspector, then connect the next step.

## Configure the fields

| Field | What to enter |
| --- | --- |
| **Expression** | Value to match against cases |
| **Cases** | Define cases and responses using ### separator:<br>###case DOC001: Doctor Profile 1<br>### case DOC002: Doctor Profile 2<br>###default: Invalid code<br><br>Accepts: ###case, ### case, ###default, or ### default<br>Flexible spacing around colon (: or : or :)<br>Response can contain any text including ### alone.<br><br>📍 For INDEXED operator, use position syntax:<br>###case [0]:new_member: 0<br>###case [1]:left_member: 1<br>###case [2]:true,[3]:administrator: 2<br>###case [4]:!info: 4<br>Pattern format: [index]:value or [index1]:value1,[index2]:value2 for multiple positions |
| **Match Operator** | How to match patterns:<br><br>🔹 EQUALS (default) - Exact match:<br>  Expression: 'hello'<br>  Pattern: 'hello' ✅ matches<br>  Pattern: 'Hello' ❌ no match (unless ignoreCase=yes)<br>  Pattern: 'hell' ❌ no match<br><br>🔹 CONTAINS - Substring match:<br>  Expression: 'hello world'<br>  Pattern: 'world' ✅ matches<br>  Pattern: 'lo wo' ✅ matches<br>  Pattern: 'goodbye' ❌ no match<br><br>🔹 WILDCARD - Prefix match (new!):<br>  Expression: 'hello world'<br>  Pattern: 'hello*' ✅ matches (prefix)<br>  Pattern: 'hell*' ✅ matches<br>  Pattern: 'world*' ❌ no match<br><br>🔹 INDEXED - Position-based match (for combined expressions):<br>  Expression: 'value1\|value2\|true\|admin\|!help'<br>  Pattern: '[0]:value1' ✅ checks position 0<br>  Pattern: '[2]:true,[3]:admin' ✅ checks positions 2 AND 3 (both must match)<br>  Pattern: '[4]:!help' ✅ checks position 4<br>  Pattern: '[0]:*' ✅ checks if position 0 is NOT empty (wildcard)<br>  Pattern: '[4]:!advice*' ✅ matches any value at position 4 starting with '!advice' (prefix wildcard)<br><br>  Perfect for routing logic with pipe-separated variables!<br>  Split by '\|' delimiter, then match specific positions.<br>  Multiple positions: separate with comma, ALL must match.<br>  Special wildcard '*' matches any non-empty value.<br>  Prefix wildcard 'value*' matches any value starting with 'value'.<br><br>💡 Use Cases:<br>  • equals: Command routing (!help, !info)<br>  • contains: Keyword detection (spam, link)<br>  • wildcard: Prefix command routing (!advice*, !quote*)<br>  • indexed: Complex routing (events + status + commands)<br>Choices: `equals`, `contains`, `wildcard`, `indexed`.<br>Example/default shown in the editor: `equals`. |
| **Ignore Case** | Case-insensitive matching (yes/no)<br>Choices: `yes`, `no`.<br>Example/default shown in the editor: `yes`. |

## Use the result

Choose the output from the variable picker in a later step. Output names below identify the values supplied by this node; the picker inserts the correct reference for your node instance.

| Output | Meaning / label |
| --- | --- |
| `result` | Matched Response |

## Connect the next step

Connect the continuation shown on the canvas. Some nodes calculate their branches from the configured options. Read each branch label in the editor and connect the paths your workflow needs.

## Test it in a workflow

1. Configure this node with a small, recognizable test input or a test resource.
2. Check the variables from preceding steps and the connection selected in the inspector.
3. Save the workflow. For event-driven flows, generate the actual event; use **Run** only for a Manual workflow.
4. Open **Workflow Activity** and check the outcome before enabling wider use.

## If something goes wrong

- Check empty variables, selected resource IDs, and any fields that appeared after resource selection.
- Check the failed step in Workflow Activity before retrying. If the action may already have completed, inspect the destination first to avoid duplicates.
- Follow the [troubleshooting guide](/help/troubleshooting/) for a symptom-by-symptom checklist.

## Related guides

- [Work with variables](/workflows/variables/)
- [Understand branches and error handling](/workflows/branches/)
- [Browse all nodes](/reference/nodes/)



## Catalog coverage

This is the currently documented selection. Chatigram continues to add nodes, triggers, App Connections, and integrations. Use each page’s review date and the current application selectors to check what is available now; this catalog is not a fixed limit on future features.
