Skip to main content

Switch

The Switch activity is used to evaluate a condition and execute a specific set of activities based on the result of the evaluation.

Setup​

Condition

  • Description: The field or expression to evaluate for the Switch activity. This typically references workflow data (e.g., {{payload.status}}, {{global_variables.value}}, or the result of a previous activity).
  • Required: Yes

Configure​

Cases

  • Description: Define multiple cases for comparison. Each case includes a data type and a value.
  • Type: The data type used for comparison (e.g., Number, String).
  • Case: The value to match against the evaluated condition.

You can specify a condition for the Switch, and based on the value it evaluates to, the workflow will follow the corresponding branch. Each branch can then connect to the next set of nodes.

Example​

Condition: payload.usecase

Cases:

  • Type: Number → Case: 23
  • Type: String → Case: asdas

Fallback​

If none of the defined cases match the condition value, the Switch activity can execute a Default branch (or fallback path). If no default branch is provided, the workflow will skip this activity or stop based on the workflow configuration.