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.
OperatorNameLogicExample Pattern
==EqualsDoes A equal B?channel == "whatsapp"
!=Not EqualsIs A anything except B?status != "opt-out"
>Greater ThanIs A bigger than B?message_count > 5
>=Greater or EqualIs A bigger or the same as B?credit_balance >= 10.00
<Less ThanIs A smaller than B?retry_attempts < 3
<=Less or EqualIs A smaller or the same as B?days_inactive <= 7
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:
country == "US" && !status == "unsubscribed" || role == "admin"
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.
GoalCondition StringExplanation
Business Hours Onlycurrent_hour >= 9 && current_hour < 18Sends only between 9 AM and 6 PM.
Exclude Weekendsday_name != "Saturday" && day_name != "Sunday"Blocks messages on Sat/Sun.
Specific Days Onlyday_name in [Monday, Wednesday, Friday]Only allows Mon/Wed/Fri.
Morning Rushcurrent_hour <= 10Matches times before or at 10 AM.

2. Budget & Limits

Assuming variables like wallet_balance, msg_cost, retry_count.
GoalCondition StringExplanation
Sufficient Fundswallet_balance >= msg_costCheck if user can afford the message.
Stop Infinite Loopsretry_count < 5Only retry if attempted less than 5 times.
High Value Checkcampaign_budget > 1000Checks for large budget campaigns.
Safety Capdaily_sent <= 10000Stops sending if daily limit is reached.

3. Smart Routing

Deciding which channel (SMS, WhatsApp, Email) to use.
GoalCondition StringExplanation
WhatsApp Priorityhas_whatsapp == "true" && opt_in == "true"Use WhatsApp only if installed AND opted-in.
Fallback Logicchannel == "sms"Use SMS as fallback channel.
Vendor Selectioncountry == "US"Route by country.
Cheap Routemsg_type == "marketing" && cost < 0.05Send marketing only if route is cheap.

4. Audience Targeting

Filtering specific types of users.
GoalCondition StringExplanation
VIP Listplan in [gold, platinum, enterprise]Matches high-tier users.
Active Usersstatus == "active" && !is_blockedUser must be active AND not blocked.
Specific Domainemail matches "@pixelcorp\.com$"Matches only PixelCorp employee emails.
Local Userszip_code matches "^902\d{2}$"Matches zip codes starting with 902 (e.g., 90210).

5. Content Validation

Checking the message data before sending.
GoalCondition StringExplanation
No Empty Msgmessage_body != ""Ensures message is not empty.
Contains Linkmessage_body matches "https?://"Checks if a link exists in the text.
Length Checkchar_count <= 160Checks if message fits in one SMS segment.
Variable Existsfirst_name != "null" && first_name != ""Ensures name is available for personalization.

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"