Skip to main content

Switch

Sends the workflow down one of several paths. You define an ordered list of rules; Switch checks them from top to bottom and continues on the output of the first rule that matches. When no rule matches, it continues on Fallback.

Switch is configured in its own dialog (Configure Switch) rather than the regular property panel.

Settings​

SettingRequiredDefaultDescription
Value to pass on (value)No—Any value (usually an expression) to hand to the next step as output.value. It is not used for matching.
Rules (rules)YesCase 1, Case 2Each rule has a name and a set of conditions combined with AND or OR. At least one rule is required.

Each rule's conditions use the same builder, value types and operators as Filter. Write the values you want to test as expressions, e.g. {{ $trigger.body.type }}. A rule with no conditions is skipped.

Use the arrows to reorder rules — order matters, because the first match wins. Add rule adds a new output; Remove rule deletes it and the connections from its output.

Ports​

PortDescription
main (input)The step(s) Switch runs after.
case1, case2, …One output per rule, labelled with the rule's name. The port key (case1, case2, …) stays the same when you rename or reorder rules.
fallbackTaken when no rule matches. Always listed last.

Only the chosen output continues; branches connected to the other outputs are skipped.

Output​

{
"matched": "case2",
"rule": "Refund",
"value": { "type": "refund", "orderId": 4417 }
}
FieldDescription
matchedThe port that was taken (case1, …, or fallback).
ruleThe matching rule's name, or Fallback.
valueThe resolved Value to pass on.

Example​

Route incoming webhook events by type:

  • Value to pass on: {{ $trigger.body }}
  • Rule Order (case1): {{ $trigger.body.type }} equals order.created
  • Rule Refund (case2): {{ $trigger.body.type }} equals refund.created
  • Fallback: connect a Throw Exception step to fail on unknown events.

Notes​

  • A rule without an output key, or malformed rules, fail the step.
  • For a simple two-way branch, If / Else is enough. To filter the items of a list, use Filter.