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

  • 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

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
left_operandstringYesReference to the field to evaluate. Format is datablock or datablock.property (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 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

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

{
"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"
}