---
updatedAt: 2026-09-01T16:18:50.000Z
---

Fetch the complete documentation index at: https://developers.wabbit.gg/llms.txt. Use this file to discover all available pages before exploring further. Append .md to any documentation page URL to get its markdown version.

# Switch

# Switch

Match a value against several cases and run the first one that matches

## Fields

| Field     | Type                                         | Required | Description                                                                         |
| --------- | -------------------------------------------- | -------- | ----------------------------------------------------------------------------------- |
| `value`   | operand ({ path } or { literal })            | yes      | The value to match.                                                                 |
| `cases`   | array of { when: operand, steps }, non-empty | yes      | Matching is strict equality only — the first case whose 'when' equals 'value' runs. |
| `default` | array of steps                               | no       | Runs if no case matches.                                                            |

## Example

```json
{
  "id": "01H8XGJVBWX7Y5Z3K9M2N4P6Q1",
  "type": "switch",
  "value": {
    "path": "vars.run.choice"
  },
  "cases": [
    {
      "when": {
        "literal": "a"
      },
      "steps": []
    }
  ],
  "default": []
}
```