Switch Step

Multi-branch router that picks one path based on a value.

What it does

  • Evaluates one runtime value and selects exactly one branch (the first matching case).
  • Produces an output payload from the selected case, or from default when no case matches.
  • Supports match types for equality/inequality, string checks, numeric comparisons, existence/emptiness checks, and range/list membership checks.

When to use it

  • When you have more than two possible outcomes and want clear, labeled routes.
  • To keep complex routing readable without nesting many Conditionals.
  • When you want a deterministic “router” based on a single value (for example: order status, marketplace, country, error code, numeric score).

How to configure

On the Switch step modal, you configure three things: the input value to inspect, one or more cases, and an optional default output.

1) Value to Switch On

Fill the field labeled Value to Switch On with a reference (mapped value) like data.order.status, steps.detect.outputs.type, variables.marketplace

Switch evaluates exactly one expression and assigns its result to an internal “value” used for matching.

2) Cases (one matching branch per case)

Click Add Case to create a new case. For each case you must set:

  • Match type
    • Which comparison is applied between Value to Switch On and the case Match value.
    • Available options correspond to the match types documented below (for example EQ, STARTS_WITH, IN, BETWEEN, RANGE, etc.).
  • Match value
    • The value (or structure) used by the selected Match type.
    • Must be compatible with both the Value type you selected and the semantics of the chosen operator (see “Match types” below for the expected shapes).
  • Output (JSON payload)
    • The JSON result produced when the case matches (the value you will read later as Switch outputs).
    • Recommended shape: a JSON object with stable keys (for example { "action": "new_order", "status": "new" }).

Cases are evaluated in the order they appear in the modal. The first matching case wins, so order from most specific to most general.

3) Default output (optional)

The Default field (JSON input) is used when none of your cases match:

  • If you set it, Switch outputs that JSON payload.
  • If you leave it empty / delete it, Switch output is absent (treat downstream mappings as optional).

Typical patterns

  • Route by order status (new, fulfilled, canceled), channel/marketplace, file type, or error code.
  • Apply different transformations per country or region.
  • Send failed records to a recovery path while successes continue.