Skip to main content
The Condition Node checks a specific rule (a “condition”) and decides which path the data should take next.

How It Works

  • You write a simple sentence (a rule).
  • If the rule is True, the flow follows the path connected to that rule.
  • If the rule is False, the flow moves to the next rule or the “Else” (fallback) path.

1. Comparing Values (Basic Operators)

These operators check if a value matches, is greater than, or differs from another value.
You can use quotes for text ("whatsapp") but they are usually optional. Numbers do not need quotes.
Real-world examples:
  • Send SMS only if the user is verified: user_verified == "true"
  • Send RCS only if the balance is positive: wallet_balance > 0

2. Checking Lists (The in Operator)

Use the in operator to check if a value belongs to a specific group or list. This is faster than writing multiple “OR” rules. Syntax: VariableName in [Item1, Item2, Item3] or VariableName in item1, item2 Examples:
  • state in [NY, CA, TX] — True if the state is New York, California, or Texas
  • status in [pending, processing]
Real-world examples:
  • Send via WhatsApp if the country supports it: country_code in [IN, BR, ID, US]
  • Process only specific message statuses: delivery_status in [failed, undelivered]
  • Target specific user tags: user_tag in [vip, premium, beta_tester]

3. Pattern Matching (The matches Operator)

For advanced users only. Use matches to check if text follows a specific pattern (like a phone number format or email domain) using Regex. Syntax: variable matches pattern Real-world examples:
  • Check if the phone number is an Indian mobile number: phone matches "^91\d{10}$"
  • Send email only to corporate domains: email matches "@company\.com$"
  • Validate an OTP format (4 digits): otp_input matches "^\d{4}$"

4. The “NOT” Operator (!)

Use ! to reverse a rule. If the rule inside is True, the ! makes it False. Syntax: !variable == value Real-world examples:
  • Send SMS if the user is NOT blocked: !status == "blocked"
  • Proceed if the email is NOT empty: !email == ""
  • Target users who are NOT in the ‘churn’ list: !segment == "churned"

5. Combining Rules (&& and ||)

You can mix and match rules to create complex logic.

The AND Operator (&&)

Both sides must be true for the condition to pass. Syntax: Condition A && Condition B Example: age > 18 && country == "USA"
Meaning: “The user must be over 18 AND they must live in the USA.”
Real-world examples:
  • Send WhatsApp if the user has opted in AND has a valid phone number: opt_in_whatsapp == "true" && phone_valid == "true"
  • Send critical alert if priority is high AND status is pending: priority == "high" && status == "pending"

The OR Operator (||)

At least one side must be true for the condition to pass. Syntax: Condition A || Condition B Example: role == "admin" || role == "manager"
Meaning: “Let them in if they are an Admin OR if they are a Manager.”
Real-world examples:
  • Send message via cheaper channel (SMS OR RCS): channel_preference == "sms" || channel_preference == "rcs"
  • Retry sending if the error was ‘timeout’ OR ‘busy’: error_code == "timeout" || error_code == "busy"

Summary of Priority

When you write a complex rule, the system checks them in this order:
  1. ! (NOT) checks happen first.
  2. && (AND) groups are checked next.
  3. || (OR) splits are checked last.
Complex example:
Translation: “Send the message if: (The user is in the US AND is not unsubscribed) OR (The user is an Admin).” In this system, the “AND” (&&) operator splits the rule first. Rule: A || B && C is treated as (A or B) AND C. This is helpful for scenarios like: “Match either channel AND ensure the user is active.”

Cheat Sheet Examples

Common use cases in messaging or notification workflows:
  • Check for VIP customers: total_spent >= 1000
  • Check if an order is active: status != "cancelled"
  • Send email only to Gmail users: email matches "@gmail.com"
  • Check logic for shipping fees: country == "UK" && order_value < 50

Use Case Reference

1. Scheduling & Time Windows

Assuming you have variables like current_hour (0–23) or day_name.

2. Budget & Limits

Assuming variables like wallet_balance, msg_cost, retry_count.

3. Smart Routing

Deciding which channel (SMS, WhatsApp, Email) to use.

4. Audience Targeting

Filtering specific types of users.

5. Content Validation

Checking the message data before sending.

6. Complex Combinations

Combining multiple factors. Scenario: Send a promo if the user is a VIP OR it’s their birthday, BUT they must be opted-in.
  • Condition: is_vip == "true" || is_birthday == "true" && active_optin == "true"
  • Logic: (VIP OR Birthday) AND Opted-In
Scenario: Send via RCS if phone supports it, otherwise check if SMS is allowed. This usually requires two steps, but in one node:
  • Condition: rcs_enabled == "true" || sms_fallback_allowed == "true"