Skip to content

Switch

Routes data to different branches based on conditions. Each item flowing through the Switch node is evaluated against your rules and sent to the first matching output, or to the fallback output if no rule matches.

Configuration

Routing Rules

You can define up to 10 routing rules. Each rule creates a separate output handle (labeled case-1, case-2, etc.) and contains a condition group with one or more conditions joined by AND/OR logic.

Each condition within a rule has three parts:

PartDescription
InputA field path to evaluate, e.g., data.status or data.user.role
OperationThe comparison to perform (see table below)
ValueThe value to compare against (not required for all operations)

Available Operations

OperationDescriptionRequires Value
equalsExact string matchYes
not_equalsDoes not matchYes
greater_thanNumeric greater thanYes
less_thanNumeric less thanYes
greater_than_or_equalsNumeric greater than or equalYes
less_than_or_equalsNumeric less than or equalYes
containsInput contains the value as a substringYes
not_containsInput does not contain the valueYes
starts_withInput starts with the valueYes
ends_withInput ends with the valueYes
inInput matches one of the comma-separated valuesYes
not_inInput does not match any of the comma-separated valuesYes
matches_regexInput matches a regular expressionYes
is_emptyInput is an empty stringNo
is_not_emptyInput is not emptyNo
is_trueInput is true or 1No
is_falseInput is false or 0No
is_typeChecks the data type of the inputYes

Condition Logic

Within each rule, you can combine multiple conditions using:

  • AND -- All conditions must be true for the rule to match
  • OR -- At least one condition must be true for the rule to match

Output

The Switch node creates one output handle per rule, plus a fallback handle:

  • case-1, case-2, ... case-N -- Items that match the corresponding rule
  • fallback -- Items that do not match any rule

Each item is sent to the first matching rule only. If an item matches both rule 1 and rule 3, it goes to case-1.

TIP

Order your rules from most specific to least specific, since items are routed to the first match.

INFO

Items that arrive when no rules are configured will all be routed to the fallback output.