If / Else Node
Route your workflow down a TRUE or FALSE path based on one or more conditions. Use it to branch on payment status, OTP verification, order value, message type, and more.
How It Works
- Configure one or more conditions using a left-hand value, an operator, and a right-hand value
- Connect downstream nodes to the TRUE handle and the FALSE handle separately
- When the workflow reaches the If / Else node, it evaluates the condition and routes execution accordingly
- Nodes on the TRUE branch only run when the condition passes; nodes on the FALSE branch only run when it fails
Group multiple conditions with AND (all must be true) or OR (any must be true) to build compound logic.
Available Operators
| Operator | Description | Example |
|---|---|---|
equals | Exact match (string or number) | {{msg91.verified}} equals true |
not_equals | Does not match | {{razorpayTrigger.event}} not_equals "payment.failed" |
contains | String contains substring | {{whatsappTrigger.text}} contains "track" |
not_contains | String does not contain | {{body.email}} not_contains "spam" |
starts_with | String starts with prefix | {{whatsappTrigger.from}} starts_with "91" |
ends_with | String ends with suffix | {{body.email}} ends_with ".in" |
greater_than | Numeric greater than | {{razorpayTrigger.payload.payment.entity.amount}} greater_than 50000 |
less_than | Numeric less than | {{shiprocket.shipment_id}} less_than 999999 |
greater_than_or_equal | Numeric ≥ | {{body.quantity}} greater_than_or_equal 10 |
less_than_or_equal | Numeric ≤ | {{body.discount}} less_than_or_equal 100 |
is_empty | Value is null, undefined, or empty string | {{body.notes}} is_empty |
is_not_empty | Value exists and is non-empty | {{whatsappTrigger.text}} is_not_empty |
is_true | Boolean true check | {{msg91.verified}} is_true |
is_false | Boolean false check | {{shiprocket.serviceable}} is_false |
regex_match | Value matches regex pattern | {{body.phone}} regex_match ^91\d{10}$ |
Complete Workflow Examples
OTP Verification Gate
Use case: Only create a user account if the OTP is valid.
textWorkflow
Webhook Trigger (POST /verify, body: { mobile, otp })
→ MSG91 — Verify OTP
mobile: {{body.mobile}}
otpValue: {{body.otp}}
→ If / Else
Condition: {{msg91.verified}} equals true
TRUE → Set Variable: userPhone = {{body.mobile}}
→ HTTP Response: {"success": true}
FALSE → HTTP Response: {"error": "Invalid OTP"}High-Value Order Alert
Use case: Send a special alert for orders above ₹5,000.
textWorkflow
Razorpay Trigger (payment.captured)
→ If / Else
Condition: {{razorpayTrigger.payload.payment.entity.amount}} greater_than 500000
(note: 500000 paise = ₹5,000)
TRUE → Slack — Send Message
channel: #vip-orders
text: "🌟 VIP order! ₹{{razorpayTrigger.payload.payment.entity.amount}} from
{{razorpayTrigger.payload.payment.entity.email}}"
FALSE → (no action — normal flow continues)Delivery Serviceability Check
Use case: Only create a Shiprocket order if the PIN code is serviceable.
textWorkflow
Webhook Trigger (POST /checkout, body: { pincode, ... })
→ Shiprocket — Check Serviceability
pickupPostcode: 400001
deliveryPostcode: {{body.pincode}}
→ If / Else
Condition: {{shiprocket.serviceable}} is_true
TRUE → Shiprocket — Create Order ...
FALSE → HTTP Response: {"error": "Sorry, we don't deliver to your PIN code yet."}Common Issues & Solutions
| Issue | Cause | Solution |
|---|---|---|
| Condition always goes FALSE | Type mismatch — comparing string to number | Wrap number comparisons in quotes or use greater_than operator instead of equals for numbers |
| regex_match not working | Backslashes need escaping | Use \\d instead of \d in the regex pattern field |
| Variable is undefined | Upstream node didn't produce that variable | Add an is_not_empty condition first to guard against undefined values |
Related Nodes
- Switch — route to one of N branches instead of just TRUE/FALSE
- MSG91 — check
{{msg91.verified}}after Verify OTP - Shiprocket — check
{{shiprocket.serviceable}}before creating orders