Quester Studio

switch

Multi-branch on a templated expression or JMESPath (sourceHandle per case)

Picks an outgoing edge by matching a string value against cases. Extends the if branching model with more than two handles.

Use templated expression for run/vars/nodes fields, or path as JMESPath on previous (body.type, not previous.body.type). See How flows work.

in ×1 switch case… case… default
One handle per case plus default.

Data

FieldTypeDescription
labelstringOptional UI label
expressionstringOptional templated string used for matching
pathstringOptional JMESPath on previous output; result is stringified
casesarray{ value, handle } — at least one case
defaultHandlestringHandle when nothing matches (default "default")

Provide expression and/or path.

Input / output

Value
Execute inputPrevious node output
Output{ "matched": "<handle>" }
BranchThe matched handle (or default) — must match sourceHandle on edges

Edges

{
  "id": "e-ok",
  "source": "byStatus",
  "target": "okPath",
  "sourceHandle": "ok"
}

Examples

Templated expression

{
  "id": "byStatus",
  "type": "switch",
  "data": {
    "expression": "{{nodes.head.status}}",
    "cases": [
      { "value": "200", "handle": "ok" },
      { "value": "404", "handle": "missing" }
    ],
    "defaultHandle": "other"
  }
}

JMESPath on previous HTTP output

{
  "data": {
    "path": "status",
    "cases": [{ "value": "200", "handle": "ok" }],
    "defaultHandle": "other"
  }
}