Skip to main content

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

  • Multiple Outgoing Transitions: Must have multiple outgoing transitions
  • 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

AttributeTypeRequiredDescription
choicesarrayYesArray of choice objects that define conditional branches. Must contain at least one choice object. Evaluated sequentially in array order until one matches.
defaultstringYesDefault 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.

AttributeTypeRequiredDescription
conditionsarrayYesArray of condition objects that must ALL be true (AND logic).
thenstringYesroute 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.

AttributeTypeRequiredDescription
leftOperandstringYesThe path to the field to evaluate. Uses dot notation for nested access (e.g., "documentVerification.verdict").
operatorenumYesComparison operator to apply. See Condition Operators below.
valueanyConditionalSingle value for comparison. Required for operators: gt, lt, gte, lte, eq, ne.
rangearrayConditionalArray 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 path within that data block specifies the field to be used for evaluating the condition. Field paths are case-sensitive.

Condition operators

OperatorDescriptionRequires
eqEqualvalue
neNot equalvalue
gtGreater thanvalue
ltLess thanvalue
gteGreater than or equalvalue
lteLess than or equalvalue
betweenBetween range (inclusive)range
not_betweenNot between rangerange

Example

{
"id": "2",
"type": "CHOICE",
"options": {
"choices": [
{
"conditions": [
{
"leftOperand": "documentVerification.verdict",
"operator": "eq",
"value": "success"
}
],
"then": "success"
},
{
"conditions": [
{
"leftOperand": "documentVerification.verdict",
"operator": "eq",
"value": "failure"
}
],
"then": "failure"
},
{
"conditions": [
{
"leftOperand": "basicIdentity.birthDate",
"operator": "between",
"range": ["2024-06-01", "2024-06-30"]
}
],
"then": "success"
}
],
"default": "error"
},
"next": [
{ "id": "3", "route": "failure" },
{ "id": "4", "route": "success" },
{ "id": "5", "route": "error" }
]
}