decision control
Nodes

Switch

Branches on the first matching case, with a Default for the rest.

The Switch node tests a list of cases in order and follows the first one that holds. When none does, it takes the always-present Default port.

When to use it

  • Route by category: product type, customer segment, country group.
  • Replace a chain of nested conditions with one readable node.

How it works

  1. Cases are evaluated top to bottom, each one a boolean expression.
  2. The first truthy case wins and its port is taken. The rest are not evaluated.
  3. If no case holds, the run takes Default.

Ports

PortTaken when
One port per caseThat case was the first to hold. The port is named after the case label.
DefaultNo case held. Always present and cannot be removed.

Configuration

FieldWhat it does
NameLabel shown on the canvas and in the trace.
CasesA label and an expression for each case. Order matters.

What it writes

No variables. The trace records the matched case (case_id, case_label), or that the Default branch was taken.

In a real flow

A switch on the loan product sends each product to its own rate calculation. Anything unexpected goes to manual review through Default.

When it fails

  • A case expression cannot be evaluated: the run fails with EXPRESSION_FAILED and names the case.
  • A case without an expression, a duplicated case id or a case named default are errors in Checks.

Good to know

  • Only one path runs. If two things must happen, put them one after the other on the same branch rather than side by side.
  • Renaming a case label never rewires the graph; the port keeps its identifier. Deleting a case removes its connection.
  • Put the most specific case first: the first match wins.

On this page