D: Are you new to n8n and wondering how to use the powerful If Node effectively? π€ This guide will walk you through 10 real-world scenarios where the If Node can automate your workflows like magic! β¨
π What is the If Node in n8n?
The If Node is a conditional logic node that allows your workflow to make decisions based on data. It works like an “if-else” statement in programming, helping you route data dynamically.
π Basic Structure:
IF (Condition is TRUE) → Execute Path A
ELSE → Execute Path B
π 10 Practical Scenarios for the If Node
1οΈβ£ Filtering Incoming Emails π§
Use Case: Automatically categorize emails as “Urgent” or “Normal” based on keywords.
β
How?
- Set condition:
{{$json.subject}} contains "URGENT"
- If TRUE β Send to Slack #urgent-channel
- If FALSE β Move to general inbox
2οΈβ£ Social Media Auto-Reply π¬
Use Case: Reply differently to Twitter mentions based on sentiment.
β
How?
- Use Sentiment Analysis Node before If Node
- Condition:
{{$json.sentiment}} === "positive"
- If TRUE β Send “Thank you! π”
- If FALSE β Send “Sorry to hear that. How can we help? β€οΈ”
3οΈβ£ E-commerce Order Processing π
Use Case: Split orders into “Express Shipping” or “Standard Shipping” based on order value.
β
How?
- Condition:
{{$json.order_total}} > 100
- If TRUE β Assign to express shipping
- If FALSE β Assign to standard shipping
4οΈβ£ Weather-Based Notifications β
Use Case: Send an umbrella alert if rain is forecasted.
β
How?
- Fetch weather data via API
- Condition:
{{$json.weather}} includes "rain"
- If TRUE β Send SMS: “Bring an umbrella! π§οΈ”
5οΈβ£ Lead Qualification in CRM π
Use Case: Tag high-value leads based on budget.
β
How?
- Condition:
{{$json.budget}} >= 5000
- If TRUE β Tag as “VIP Lead”
- If FALSE β Tag as “Regular Lead”
6οΈβ£ Automated Expense Approvals π°
Use Case: Auto-approve expenses under $100, flag others for review.
β
How?
- Condition:
{{$json.amount}} <= 100
- If TRUE β Auto-approve β
- If FALSE β Notify manager for review π©
7οΈβ£ Dynamic Content Publishing π’
Use Case: Post different blog links based on user interest.
β
How?
- Condition:
{{$json.user_interest}} === "marketing"
- If TRUE β Share marketing blog
- If FALSE β Share general updates
8οΈβ£ IoT Smart Home Automation π
Use Case: Turn lights on only if motion is detected AND it's nighttime.
β
How?
- Condition:
{{$json.motion_detected}} === true AND {{$json.time}} === "night"
- If TRUE β Trigger lights ON π‘
9οΈβ£ Support Ticket Prioritization π¨
Use Case: Escalate tickets with “Critical” in the subject.
β
How?
- Condition:
{{$json.subject}} includes "Critical"
- If TRUE β Notify Level 2 Support
- If FALSE β Assign to Level 1
π A/B Testing Notifications π²
Use Case: Send different promo codes to users in Group A vs. Group B.
β
How?
- Condition:
{{$json.user_group}} === "A"
- If TRUE β Send “CODE10”
- If FALSE β Send “CODE20”
π‘ Pro Tips for Using If Node
β Combine Multiple Conditions with AND
/ OR
β Test Conditions using Debug Node
β Use “Compare” Mode for numbers/dates
π― Final Thoughts
The If Node is a game-changer in n8n workflows! π Whether you're filtering data, routing tasks, or personalizing responses, mastering it will supercharge your automations.
π Try these scenarios today and see the magic happen!
Got questions? Drop them below! π π