Condition Node
Condition Node
Section titled “Condition Node”Module ID: ion.action.condition
The Condition node evaluates one or more conditions and routes the flow based on whether all conditions are true or false.
Overview
Section titled “Overview”Use the Condition node to create if/then/else logic in your flows. It evaluates a list of conditions against the input data and outputs to then if all pass, or false if any fail.
Handles
Section titled “Handles”| Handle | Description |
|---|---|
input | Data to evaluate |
Outputs
Section titled “Outputs”| Handle | Description |
|---|---|
then | All conditions evaluated to true |
false | At least one condition evaluated to false |
error | Invalid configuration or evaluation error |
Configuration
Section titled “Configuration”The node expects an array of condition objects:
// node.data structure[ { field: string, // Value from input to compare operator: string, // Comparison operator value: string // Expected value }]Operators
Section titled “Operators”| Operator | Description |
|---|---|
is_equal | Field equals value |
is_not_equal | Field does not equal value |
is_greater | Field is greater than value |
is_greater_equal | Field is greater than or equal to value |
is_less | Field is less than value |
is_less_equal | Field is less than or equal to value |
Example Configuration
Section titled “Example Configuration”Check if order status is “shipped”:
[ { "field": "{{input.order.status}}", "operator": "is_equal", "value": "shipped" }]Multiple conditions (AND logic):
[ { "field": "{{input.quantity}}", "operator": "is_greater", "value": "0" }, { "field": "{{input.status}}", "operator": "is_not_equal", "value": "cancelled" }]Behavior
Section titled “Behavior”- Receives input data on
inputhandle - Iterates through each condition in the array
- For each condition:
- Extracts
fieldvalue - Compares with
valueusingoperator
- Extracts
- If ALL conditions pass → outputs to
then - If ANY condition fails → outputs to
false - On error (invalid operator, bad data) → outputs to
error
Common Patterns
Section titled “Common Patterns”Check Order Status
Section titled “Check Order Status”[Input] → [Condition: status=shipped] → then → [Send Notification] → false → [Wait]Validate Data
Section titled “Validate Data”[Input] → [Condition: required fields exist] → then → [Process] → false → [Error Handler]Error Cases
Section titled “Error Cases”| Error | Cause |
|---|---|
| ”Operator is not a string” | Invalid operator value |
| ”Operator is not valid” | Unrecognized operator |
| ”Data is not a collection” | Condition item format invalid |
| ”Data is not an Array” | node.data is not an array |
See Also
Section titled “See Also”- Switch Node - For multi-way routing
- Flow Nodes Overview