Condition
Branching
Condition is a widget flow node that enables branching of the flow based on specified conditions.
Description
The widget flow node contains multiple branches, each of which may include conditions. Each branch is evaluated sequentially from top to bottom. A branch can operate in one of two combination modes: OR or AND:
- OR requires at least one condition in the branch to be true;
- AND requires all conditions in the branch to be true.
If a branch evaluates as true, the widget flow continues along that branch. If no branch matches, the widget flow proceeds along the default branch (if defined).
Configuration
The configuration consists of a set of branches. Each branch includes a number of conditions and a combination mode (OR/AND). Conditions may reference context values. Each condition uses an operator, and the following operators are supported:
Name | Description | Operand Count |
---|---|---|
Equals (== ) | Checks if the two values are equal | 2 |
Not equals (!= ) | Checks if the two values are not equal | 2 |
Greater than (> ) | Checks if the first value is greater than the second (as number) | 2 |
Greater than or equal (>= ) | Checks if the first value is greater than or equal to the second (as number) | 2 |
Less than (< ) | Checks if the first value is less than the second (as number) | 2 |
Less than or equal (<= ) | Checks if the first value is less than or equal to the second (as number) | 2 |
Empty | Checks if the value is empty or not provided | 1 |
Not empty | Checks if the value is present and not empty | 1 |
Contains | Checks if the first value contains the second as a substring | 2 |
Not contains | Checks if the first value does not contain the second as a substring | 2 |
Matches | Checks if the first value matches the given regular expression | 2 |
Not matches | Checks if the first value does not match the given regular expression | 2 |
WARNING
When using numeric operators (for example, Greater than), the value will be coerced into a number. If the value is not a number or is missing at the time of evaluation, it will default to 0
. This rule also applies to context values.
Limitations
Name | Value |
---|---|
Max branches | 5 w/o default OR 4 + 1 default (up to 5 in total) |
Max conditions per branch | 10 |
Min conditions in branch | 1 |
Max condition value input length | 1024 |
Max compiled condition value length | Unlimited |
Inputs | Exactly one |
Outputs | Always equal to branches count |
Context values
This widget flow node doesn't provide any context values.