Examples
Real-world configuration examples demonstrating common If Condition patterns.
Example 1: High-Value Order Approval Routing
Route orders over $10,000 to a manager approval step. Orders at or below the threshold proceed directly to automatic fulfilment. The orderTotal variable is set by an earlier Set Variable node that extracts the total from the incoming payload.
{
"node_type": "IfCondition",
"node_id": "CheckOrderValue",
"config": {
"condition": "$var.orderTotal > 10000"
},
"connections": {
"true": ["ManagerApprovalNotify"],
"false": ["AutoFulfilOrder"]
}
}
Expected outcome: When orderTotal is 12500, the expression 12500 > 10000 resolves to true, and execution routes to ManagerApprovalNotify. When orderTotal is 750, the expression resolves to false and execution routes to AutoFulfilOrder.
Example 2: Notification Opt-Out Check
Before sending a marketing email, verify the user has not opted out. If notifications_enabled is false (or absent), skip the send step and route to a no-op end node.
{
"node_type": "IfCondition",
"node_id": "CheckNotificationOptIn",
"config": {
"condition": "$ctx.user.notifications_enabled === true"
},
"connections": {
"true": ["SendMarketingEmail"],
"false": ["LogOptOutSkip"]
}
}
Expected outcome: Users with notifications_enabled: true receive the email. Users with the flag absent or false are silently skipped, with only a log entry recorded.
Example 3: Multi-Condition Compound Expression
Apply a premium discount only if the customer is in the Gold or Platinum tier AND their cart total exceeds $500. Both conditions must be satisfied simultaneously.
{
"node_type": "IfCondition",
"node_id": "CheckPremiumDiscount",
"config": {
"condition": "(['gold','platinum'].includes($ctx.customer.tier)) && $var.cartTotal >= 500"
},
"connections": {
"true": ["ApplyPremiumDiscount"],
"false": ["ApplyStandardPricing"]
}
}
Expected outcome: A Platinum customer with a $650 cart receives the premium discount. A Gold customer with a $300 cart does not meet the second condition and proceeds through standard pricing.
Example 4: Null / Missing Field Validation
Validate that a required field is present before passing data to a downstream API integration node. If order_id is null or missing, route to an error response handler.
{
"node_type": "IfCondition",
"node_id": "ValidateOrderId",
"config": {
"condition": "$input.order_id != null && $input.order_id !== ''"
},
"connections": {
"true": ["CallFulfilmentAPI"],
"false": ["ReturnValidationError"]
}
}
Expected outcome: Payloads with a valid order_id string are forwarded to the fulfilment API. Payloads with a null or empty order_id are rejected at this node and a structured error is returned to the caller.
Example 5: Feature Flag Gate
Use a workflow variable populated from a configuration store to gate a new feature. Only users assigned to the beta programme proceed through the new code path.
{
"node_type": "IfCondition",
"node_id": "BetaFeatureGate",
"config": {
"condition": "$var.betaFeatureEnabled === true && $var.userBetaEnrolled === true"
},
"connections": {
"true": ["NewBetaCheckoutFlow"],
"false": ["LegacyCheckoutFlow"]
}
}
Expected outcome: Both the global feature flag and the user-level enrolment flag must be true for the beta path to activate. This allows safe gradual rollout — you can enable betaFeatureEnabled globally while controlling exactly which users see it via userBetaEnrolled.