Run actions only when certain conditions are met - perfect for conditional logic and branching workflows.
Common uses:
- Only update high-value deals
- Skip contacts without email addresses
- Route based on deal stage
- Check if variables exist before using them
- Different actions for different scenarios
if_condition
What This Does (The Simple Version)
Think of this like an “if this, then that” rule. You set a condition, and actions inside the if block only run when that condition is true. If it’s false, they’re skipped. Real-world example: You’re sending follow-up emails to leads. You only want to email contacts who haven’t been contacted in the last 7 days. Add an If Condition that checks “last contact date > 7 days ago” - the email action inside only runs if true.How It Works
The If Condition action evaluates a condition you provide. Based on the result: If TRUE:- Actions immediately after the If Condition run
- Continues until it reaches an Else Condition or End Condition
- Actions after the If Condition are skipped
- Jumps to Else Condition (if present) or End Condition
Setting It Up
Step 1: Add If Condition Action
When you add an If Condition action to your workflow, you’ll see a query/condition field.Step 2: Write Your Condition
In the “Condition” field, describe what you want to check in plain English. The condition is evaluated by AI - you can write it naturally: Examples: Check if a value is above a threshold:{}
or typing them:
Step 3: Add Actions to Run If True
After the If Condition, add the actions that should run when the condition is TRUE. Example:- If Condition - Check if deal amount greater than 10000
- Update HubSpot Object - Update to VIP status (runs if TRUE)
- Send Email - Notify sales director (runs if TRUE)
- End Condition - Marks end of if block
Step 4: Add Else Condition (Optional)
Want different actions if the condition is FALSE? Add an Else Condition action after your “if true” actions:- If Condition - Check if contact has email
- Send Email - (runs if TRUE)
- Else Condition
- Create Task - Manually find email (runs if FALSE)
- End Condition
Step 5: Close with End Condition
Always add End Condition at the end to close the if/else block.Condition Examples
Numeric Comparisons
String Comparisons
Empty/Exists Checks
Date Comparisons
Boolean Checks
Complex Conditions
Common Workflows
Only Update High-Value Deals
Goal: Update deal priority only if amount exceeds threshold-
Lookup HubSpot Object (V2)
- Get deal details
- Output Variable:
deal
-
If Condition
- Condition:
[deal amount] > 50000
- Condition:
-
Update HubSpot Object (V2) (inside if block)
- Update
priority
to “High”
- Update
- End Condition
Skip Contacts Without Email
Goal: Send email only if contact has email address-
Search HubSpot (V2)
- Find contacts
- Output Variable:
contacts
-
For Loop
- Loop through:
contacts
- Current item:
current_contact
- Loop through:
-
If Condition (inside loop)
- Condition:
[current contact email] is not empty
- Condition:
-
Send Email (inside if block)
- Send to:
[current contact email]
- Send to:
- End Condition
- End Loop
Route by Deal Stage
Goal: Different actions based on deal stage-
Lookup HubSpot Object (V2)
- Get deal
- Output Variable:
deal
-
If Condition
- Condition:
[deal stage] equals "closedwon"
- Condition:
-
Create Timeline Event (if won)
- Log onboarding kickoff
- Else Condition
-
Update HubSpot Object (if not won)
- Update follow-up date
- End Condition
Check Before Using Variable
Goal: Only process if search found results-
Search HubSpot (V2)
- Search for deals
- Output Variable:
deals
-
If Condition
- Condition:
[deals] is not empty
- Condition:
-
For Loop (inside if block)
- Loop through deals
- Process each deal…
- End Loop
- End Condition
Real Examples
Lead Qualification
Scenario: Auto-qualify leads based on criteria Trigger: Contact created webhook Condition:- Update lifecycle stage to “salesqualifiedlead”
- Assign to senior sales rep
- Send immediate notification
- Keep as “lead”
- Add to nurture sequence
Deal Health Check
Scenario: Flag stale deals Trigger: Scheduled (daily) Inside loop for each deal: If Condition:- Update deal property
status
to “stale” - Create task for owner to follow up
Conditional Enrichment
Scenario: Only enrich important contacts Trigger: Contact updated webhook Condition:- Run web search for company
- AI enrichment analysis
- Update contact with insights
- Log that contact wasn’t enriched
- Add to later enrichment queue
If/Else Patterns
Simple If (No Else)
If/Else
Multiple Conditions (Nested)
Sequential Checks
Troubleshooting
Condition Always TRUE (or Always FALSE)
Actions always run (or never run) Possible causes:- Condition is written incorrectly
- Variable doesn’t exist
- Variable has unexpected value
- Check execution log - what did the AI evaluate?
- Test condition with known values first
- Use simple conditions initially (e.g.,
5 > 3
should always be true) - Make sure variables exist before referencing them
- Check variable values in execution log
Can’t Access Variables
Variable in condition shows as empty Possible causes:- Variable doesn’t exist (action before if condition failed)
- Variable name spelled wrong
- Wrong path to nested property
- Check execution log - does the variable exist?
- Verify variable name matches output from previous action
- For nested properties:
[contact email]
not[contact.email]
Actions After If Condition Not Running
Expected actions are skipped Possible causes:- Condition evaluated to FALSE
- Missing End Condition
- Error inside if block
- Check execution log - what was the condition result (true/false)?
- Add End Condition after if block
- Look for errors in actions inside the if block
Else Block Not Running
Else actions don’t execute when condition is false Possible causes:- Missing Else Condition action
- Else Condition in wrong place
- Missing End Condition
- Structure must be: If Condition → [true actions] → Else Condition → [false actions] → End Condition
- Make sure Else Condition is before End Condition
- Check execution log to see execution path
Tips & Best Practices
✅ Do:- Write conditions in plain English (AI evaluates them)
- Use clear, simple conditions when possible
- Always add End Condition to close if blocks
- Test conditions with known values first
- Check execution log to see true/false result
- Use variables by clicking
{}
button for accuracy - Add Else Condition for “if false” actions
- Forget to add End Condition (required)
- Reference variables that might not exist without checking first
- Write overly complex conditions (break into multiple if statements)
- Assume condition will always evaluate as expected (test it)
- Nest too many if conditions (hard to debug)
- Clear: “The deal amount is greater than 10000”
- Specific: “The contact lifecycle stage equals ‘salesqualifiedlead’”
- Testable: Use values you can verify
- Safe: Check if variable exists first if unsure
- Conditions evaluate quickly (less than 1 second)
- Simple conditions faster than complex
- Avoid unnecessary nesting
Related Actions
Always used together:- End Condition - Required to close if blocks (can close If, For, or If/Else)
- Set Variable - Often used inside if blocks
- Use inside For Loop to conditionally process items
- Use with Update HubSpot Object (V2) to conditionally update
- Variable System - Using variables in conditions
Last Updated: 2025-10-01