Conditional Logic
Conditions let your workflow make decisions based on data. Create branches that execute different actions depending on values.
The Condition Node
The condition node evaluates an expression and creates two paths:
- True branch - Runs when the condition is met
- False branch - Runs when the condition is not met
Adding a Condition
- Add a Condition node after your trigger or action
- Configure the condition expression
- Connect nodes to both the True and False outputs
Condition Configuration
Field Selection
Choose the data field to evaluate:
- Use the variable picker to select fields
- Or type the path directly:
trigger.fields.status
Operators
| Operator | Description | Example | |----------|-------------|---------| | equals | Exact match | status equals "active" | | not equals | Not a match | status not equals "deleted" | | contains | Substring match | email contains "@company.com" | | starts with | Prefix match | phone starts with "+1" | | ends with | Suffix match | file ends with ".pdf" | | greater than | Numeric comparison | amount greater than 100 | | less than | Numeric comparison | count less than 10 | | is empty | Null/empty check | notes is empty | | is not empty | Has value | email is not empty |
Value
Enter the value to compare against:
- Static value:
"active" - Variable:
{{settings.threshold}} - Expression:
{{Date.now()}}
Multiple Conditions
AND Logic
All conditions must be true:
- Add multiple condition rows
- Set the logic to AND
- All rows must pass for True branch
Example: User is active AND has email verified
status equals "active"
AND
emailVerified equals true
OR Logic
Any condition can be true:
- Add multiple condition rows
- Set the logic to OR
- Any row passing triggers True branch
Example: Priority is high OR urgent flag is set
priority equals "high"
OR
isUrgent equals true
The Switch Node
For multiple branches (more than two), use the Switch node.
Configuration
- Select the field to switch on
- Add cases for each possible value
- Optionally add a default case
Example: Route by Department
Switch on: trigger.fields.department
Cases:
- "sales" → Send to Sales Slack channel
- "support" → Create support ticket
- "billing" → Notify finance team
- default → Send to general inbox
Nested Conditions
Create complex logic by chaining conditions:
Condition 1: Is customer?
├── True: Condition 2: Is premium?
│ ├── True: Send priority email
│ └── False: Send standard email
└── False: Send guest notification
Common Patterns
Null Checking
Check if a value exists before using it:
Field: trigger.optionalField
Operator: is not empty
String Matching
Case-insensitive matching:
Field: {{trigger.status.toLowerCase()}}
Operator: equals
Value: "active"
Numeric Ranges
Check if a value falls in a range:
Condition 1: amount >= 100
AND
Condition 2: amount <= 500
Date Comparisons
Check if a date is in the past:
Field: {{new Date(trigger.expiresAt).getTime()}}
Operator: less than
Value: {{Date.now()}}
Best Practices
- Keep it simple - Avoid deeply nested conditions
- Use Switch for multiple values - Cleaner than many conditions
- Handle all cases - Always have a default/false branch
- Test both branches - Verify both paths work correctly
- Document complex logic - Add notes explaining the reasoning
Troubleshooting
Condition always True/False
- Check your operator selection
- Verify data types match (string vs number)
- Test with known values
Unexpected branch taken
- Log the actual value before the condition
- Check for whitespace or case differences
- Verify the data path is correct
Next Steps
- Using Variables - Data in conditions
- Debugging Errors - Fix issues
- Execution Logs - Track branches taken