D: The If Node in n8n is one of the most powerful tools for workflow automation, allowing you to create conditional logic that can branch your workflows based on specific criteria. 🚀 Whether you’re a beginner or an experienced user, mastering the If Node will significantly enhance your automation capabilities.
In this guide, we’ll explore 10 practical use cases with step-by-step explanations, making it easy for you to implement them in your own workflows.
🔹 1. Filtering Incoming Emails
Scenario: Automatically categorize emails based on keywords.
How It Works:
- Use the Email Trigger node to fetch new emails.
- Add an If Node to check if the subject/body contains words like “urgent,” “support,” or “invoice.”
- Route emails to different actions (e.g., Slack alerts, Trello tasks, or Google Sheets logs).
Example Condition:
{{ $json["subject"] contains "urgent" }}
🔹 2. Auto-Approving Low-Risk Expenses
Scenario: Approve expenses under $100 automatically; flag higher amounts for review.
How It Works:
- Receive expense data via Google Forms or Airtable.
- Use the If Node to check:
- If
amount ≤ 100
→ Auto-approve (send confirmation email). - Else → Notify manager via Slack.
- If
Example Condition:
{{ $json["amount"] <= 100 }}
🔹 3. Dynamic CRM Updates
Scenario: Update Salesforce contacts only if they meet certain criteria (e.g., “VIP” tag).
How It Works:
- Fetch contact data from HubSpot or Pipedrive.
- Use If Node to check for tags like “VIP” or “High-Value.”
- Trigger personalized follow-ups or special discounts.
Example Condition:
{{ $json["tags"] includes "VIP" }}
🔹 4. Weather-Based Notifications
Scenario: Send an umbrella reminder if rain is forecasted.
How It Works:
- Pull weather data from OpenWeatherMap API.
- Use If Node to check:
- If
weather == "rain"
→ Send SMS via Twilio. - Else → Do nothing.
- If
Example Condition:
{{ $json["weather"][0]["main"] == "Rain" }}
🔹 5. Social Media Auto-Engagement
Scenario: Like tweets containing your brand name.
How It Works:
- Monitor Twitter via Twitter Trigger.
- Use If Node to check if the tweet contains “@YourBrand.”
- Trigger an automatic “like” or reply.
Example Condition:
{{ $json["text"] includes "@YourBrand" }}
🔹 6. E-Commerce Order Routing
Scenario: Split orders into “Express” or “Standard” shipping based on order value.
How It Works:
- Receive order data from Shopify or WooCommerce.
- Use If Node to check:
- If
order_total > 200
→ Assign “Express Shipping.” - Else → Assign “Standard Shipping.”
- If
Example Condition:
{{ $json["total_price"] > 200 }}
🔹 7. Automated Survey Responses
Scenario: Send a thank-you email only if a survey rating is 5 stars.
How It Works:
- Collect responses via Typeform or Google Forms.
- Use If Node to check:
- If
rating == 5
→ Send a thank-you email (via SendGrid). - Else → Send a feedback request.
- If
Example Condition:
{{ $json["rating"] == 5 }}
🔹 8. Smart Calendar Scheduling
Scenario: Auto-decline meetings outside business hours.
How It Works:
- Use Google Calendar Trigger for new invites.
- If Node checks:
- If
start_time < 9 AM OR end_time > 6 PM
→ Decline (via Gmail). - Else → Accept.
- If
Example Condition:
{{ $json["start"].split('T')[1] < "09:00" }}
🔹 9. Low Stock Alerts
Scenario: Notify your team when inventory drops below a threshold.
How It Works:
- Fetch stock levels from Airtable or Sheets.
- If Node checks:
- If
stock < 10
→ Post in Slack / Microsoft Teams.
- If
Example Condition:
{{ $json["quantity"] < 10 }}
🔹 10. AI-Powered Spam Filter
Scenario: Use OpenAI to detect spam in form submissions.
How It Works:
- Get form data via Webhook.
- Send text to OpenAI Node for spam detection.
- If Node checks:
- If
spam_score > 0.8
→ Move to “Spam” folder. - Else → Process normally.
- If
Example Condition:
{{ $json["openai"]["spam_score"] > 0.8 }}
🎯 Final Tips for Using If Node Effectively
✔ Test Conditions using the “Execute Node Once” feature.
✔ Combine Multiple Conditions with AND
/ OR
.
✔ Use Expressions for advanced comparisons (e.g., regex).
Now you’re ready to supercharge your n8n workflows with the If Node! 🚀 Which scenario will you try first? Let us know in the comments! 💬
(Need help? Check n8n’s official docs for more details.)