Choice
A decision step represents a conditional branching point in the flow
A decision step represents a conditional branching point in the flow. Decision steps evaluate conditions and route execution to different paths based on the result.
Key features
- Outgoing Transitions: Must have at least one outgoing transition
- Routing: Transitions should specify routes to indicate the condition result.
- No Data block I/O: Does not consume or produce data blocks directly.
- Sequential Evaluation: Evaluates choices sequentially until one matches.
- AND Logic: Each choice can have multiple conditions that must ALL be true (AND logic).
- Default Fallback: Falls back to default route if no choices match.
Configuration
| Attribute | Type | Required | Description |
|---|---|---|---|
| choices | array | Yes | Array of choice objects that define conditional branches. Must contain at least one choice object. Evaluated sequentially in array order until one matches. |
| default | string | Yes | Default route name when no choices match. Must correspond to a route defined in the next array. |
Multiple conditions:
Each choice can contain multiple conditions in the conditions array. All conditions within a choice must evaluate to true for the choice to match (AND logic). This allows for complex conditional logic such as checking multiple fields simultaneously.
Choice object
Each choice object defines a conditional branch with its target route.
| Attribute | Type | Required | Description |
|---|---|---|---|
| conditions | array | Yes | Array of condition objects that must ALL be true (AND logic). |
| then | string | Yes | Route name to use when all conditions in this choice are satisfied. Must correspond to a route defined in the next array. |
Condition object
Each condition object defines a single comparison to evaluate.
| Attribute | Type | Required | Description |
|---|---|---|---|
| left_operand | string | Yes | Reference to the field to evaluate. Format is datablock or datablock.property (e.g., "documentVerification.verdict"). |
| operator | enum | Yes | Comparison operator to apply. See Condition Operators below. |
| value | any | Conditional | Single value for comparison. Required for operators: gt, lt, gte, lte, eq, ne. |
| range | array | Conditional | Array of two values [lower, upper] for range operations. Required for operators: between, not_between. |
leftOperand Details:
The leftOperand references the last data block of this type generated by the upstream steps. The format is either datablock (to reference the entire data block) or datablock.property (to reference a specific field within it). Only one level of property access is supported. Field names are case-sensitive.
Condition operators
| Operator | Description | Requires |
|---|---|---|
| eq | Equal | value |
| ne | Not equal | value |
| gt | Greater than | value |
| lt | Less than | value |
| gte | Greater than or equal | value |
| lte | Less than or equal | value |
| between | Between range (inclusive) | range |
| not_between | Not between range | range |
Example
{
"choices": [
{
"conditions": [
{
"left_operand": "documentVerification.verdict",
"operator": "eq",
"value": "success"
}
],
"then": "success"
},
{
"conditions": [
{
"left_operand": "documentVerification.verdict",
"operator": "eq",
"value": "failure"
}
],
"then": "failure"
},
{
"conditions": [
{
"left_operand": "basicIdentity.birthDate",
"operator": "between",
"range": ["2024-06-01", "2024-06-30"]
}
],
"then": "success"
}
],
"default": "error"
}