Switch

The Switch node routes execution to different paths based on matching a value against cases. Supports N cases plus a default.

The Switch node routes execution to different paths based on matching a value against cases. Supports N cases plus a default.

Overview

PropertyValue
Inputs1
Outputsn (one per case + default)
OutputPasses through input to the matched branch

Parameters

ParameterTypeDescription
labelstringNode identifier (camelCase)
expressionexpressionValue to evaluate (e.g. $input.category)
casesstring[]Case values to match (e.g. ["case1", "case2", "case3"])

Edge Handles

  • Each case gets a source handle (index 0, 1, 2, …)
  • Default handle for non-matching values

Example

{
  "type": "switch",
  "data": {
    "label": "routeByCategory",
    "expression": "$classifier.category",
    "cases": ["sales", "support", "billing"]
  }
}

Connect edges with sourceHandle set to the case index (0, 1, 2) or the default handle for unmatched values.