Switch

Jump to Section

The Switch Stage is used to conditionally send events to different stages.

Switch Stage

Switch Cases

Labels

Optionally, each switch case can have a label. The label is used to identify the case in the UI.

Hovering over the output handle for a switch case will display that case’s label.

Expressions

Each switch case has an expression. If the expression returns to true, the event is sent to all the stages connected to that case. If the expression returns false, then the next case will be evaluated.

The switch case expression is similar to a Transform Stage Expression, with a few notable differences:

  • The expression must return a boolean value.
  • The expression cannot modify the payload.
  • Only event and system can be referenced in the expression. (stage and state cannot be used)