Skip to main content
control.switch: Multi-way routing: resolve an expression and run the first case whose value matches (else default). Cleaner than a nested control.if chain for routing an item to one of N pipelines by a discriminator field like a document type.

Configuration

Configuration fields sit at the step level (not inside with:).
string
required
Template expression whose resolved value selects the case, e.g. ”{{ doc.type }}”.
array<object>
required
Ordered cases; the first whose when matches runs. Each case has its own steps.

Output

The when value that matched, or null when the default (or no) branch ran.
Which branch executed.
Output from the executed branch (its last step).