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

  1. Configure one or more conditions using a left-hand value, an operator, and a right-hand value
  2. Connect downstream nodes to the TRUE handle and the FALSE handle separately
  3. When the workflow reaches the If / Else node, it evaluates the condition and routes execution accordingly
  4. 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

OperatorDescriptionExample
equalsExact match (string or number){{msg91.verified}} equals true
not_equalsDoes not match{{razorpayTrigger.event}} not_equals "payment.failed"
containsString contains substring{{whatsappTrigger.text}} contains "track"
not_containsString does not contain{{body.email}} not_contains "spam"
starts_withString starts with prefix{{whatsappTrigger.from}} starts_with "91"
ends_withString ends with suffix{{body.email}} ends_with ".in"
greater_thanNumeric greater than{{razorpayTrigger.payload.payment.entity.amount}} greater_than 50000
less_thanNumeric less than{{shiprocket.shipment_id}} less_than 999999
greater_than_or_equalNumeric ≥{{body.quantity}} greater_than_or_equal 10
less_than_or_equalNumeric ≤{{body.discount}} less_than_or_equal 100
is_emptyValue is null, undefined, or empty string{{body.notes}} is_empty
is_not_emptyValue exists and is non-empty{{whatsappTrigger.text}} is_not_empty
is_trueBoolean true check{{msg91.verified}} is_true
is_falseBoolean false check{{shiprocket.serviceable}} is_false
regex_matchValue 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

IssueCauseSolution
Condition always goes FALSEType mismatch — comparing string to numberWrap number comparisons in quotes or use greater_than operator instead of equals for numbers
regex_match not workingBackslashes need escapingUse \\d instead of \d in the regex pattern field
Variable is undefinedUpstream node didn't produce that variableAdd an is_not_empty condition first to guard against undefined values
  • 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