Workflow Automation

n8n Email Automation: 3 Patterns to Build Today

J
James Eriksson
··15 min read
Learn how to automate email workflows in n8n with IMAP triggers, SMTP sending, AI triage patterns, and deliverability tips. Build inbox automation today.
TL;DR
  • n8n's free tier supports 5 automated workflows per month; paid plans start at $25/month per user for unlimited workflows.
  • Gmail's API limits most accounts to 500 emails per day, but Amazon SES allows 50,000 daily at $0.10 per 1,000 emails.
  • Three core patterns--inbox AI triage, personalized outreach, and scheduled follow-ups--cover 80% of real-world email automation use cases.
  • n8n integrates 1500+ tools, so you can combine email automation with Slack alerts, database logging, and spreadsheet updates in a single workflow.

n8n can automate your email workflows by connecting to Gmail, SMTP, or IMAP inboxes to trigger actions when emails arrive or send personalized outreach at scale. You can build everything from AI-powered inbox sorting to follow-up campaigns without writing code. This guide walks you through three patterns you can implement today.

What You Can Automate: 3 Real-World Email Patterns

Email automation in n8n falls into three patterns: sorting incoming email (inbound triggers), sending personalized outreach (batch sending with enrichment), and scheduling follow-ups when specific conditions occur (time-based sequences). Most teams start with one pattern and combine them as workflows mature.

Pattern 1: Inbox AI Triage You read incoming emails via Gmail or IMAP, classify each one (e.g., "sales," "support," "junk") using an LLM like OpenAI or Claude, then apply labels automatically or trigger replies without manual sorting. This cuts inbox management time by 80%. One founder told us this workflow alone saves 2 hours daily--the AI flags urgent leads while routing routine support to a team member.

The pattern is simple: IMAP trigger listens for new emails, an LLM node analyzes the content, a conditional node branches based on classification, and label or reply nodes execute the action. n8n integrates with 1500+ tools, so you can also push classified emails to Slack, Airtable, or a database for downstream processing.

Pattern 2: Personalized Outbound Campaigns Pull a list of prospects from Google Sheets or Airtable, generate personalized cold emails using an LLM (each email references the prospect's company, role, or recent activity), then send via Gmail or SMTP with delays between sends to avoid spam filters. This combines AI personalization at scale without running afoul of Gmail's limits.

One common workflow: scrape job postings from LinkedIn, enrich that data with company info, generate a tailored subject line and body for each prospect via OpenAI, then queue emails with 10-second delays. When a prospect replies, a webhook triggers a follow-up sequence. All automated, all trackable in a single workflow.

Pattern 3: Scheduled Follow-Ups Use a Cron trigger (e.g., "every morning at 8 AM") to query a database or sheet, identify contacts who haven't replied in 3 days, and send the next email in your sequence. This is the workhorse pattern for sales teams: initial outreach, follow-up 2 days later, then a "last touch" at day 7.

Combining all three patterns is where n8n's value emerges. You can run inbound triage in the morning, then use the classification to trigger outbound sequences to prospects, closing the feedback loop without custom code.

Setting Up Your First n8n Email Workflow

Email automation in n8n starts with creating an account (free tier at n8n.cloud) or deploying locally on your own server. The workflow builder is a canvas: you drag nodes onto it, connect them with arrows, and configure each node's settings. No coding required.

Step 1: Create an Account or Deploy Locally Visit n8n.cloud and sign up with your email, or download n8n locally if you want full data privacy. The free tier includes 5 automated workflows per month--enough to test inbox triage or small outreach campaigns. Paid plans start at $25/month per user for unlimited workflows.

If you're deploying locally, run npm install -g n8n and then n8n start in your terminal. n8n will launch on your local machine at localhost:5678. Local deployment gives you complete control but requires a server or your laptop to stay running.

Step 2: Create Your First Workflow Click "New Workflow" in n8n's UI. You'll see an empty canvas. Add your first node by clicking the '+' button--n8n shows categories: Trigger Nodes, Action Nodes, Tools, etc. Start with a Trigger node (this is what starts your workflow).

Step 3: Choose a Trigger For email, pick "Gmail" or "IMAP" if you're using another provider. Configure authentication: n8n will ask for your Gmail account or IMAP credentials. For Gmail, approve OAuth2 (n8n doesn't store your password). For IMAP, provide your email address and password--n8n stores these encrypted.

Set the trigger to watch for new emails in your inbox. Configure the polling interval (e.g., check every 5 minutes) or use push notifications if your email provider supports webhooks.

Step 4: Add an Action Node Click '+' again to add a second node. For your first test, use "Slack" or "Email Send" as the action. Connect your Gmail trigger to this action with an arrow.

Step 5: Test and Activate Click the Debug button (play icon) to test the workflow. n8n will execute it once; if everything is wired correctly, you'll see a success message. Send a test email to your inbox, trigger the workflow, and watch n8n process it.

Once verified, click "Activate" to run the workflow automatically on its schedule.

Connecting Your Email: Gmail OAuth2 vs. IMAP vs. SMTP

Three methods connect your email to n8n, each with trade-offs. Your choice depends on your provider, security needs, and volume.

MethodSetup TimeUse CaseLimit
Gmail OAuth25 minutesReading Gmail, low-volume sending500 emails/day
IMAP10 minutesAny email provider, reading onlyNone, rate limited by provider
SMTP15 minutesHigh-volume sending, any providerDepends on provider (SES: 50,000/day)

Gmail OAuth2 (Easiest) Click "Gmail" in n8n, approve access via Google's login screen. n8n stores a secure token that renews automatically. You can read and send emails without storing your password.

Drawback: Gmail limits most accounts to 500 emails per day via its API. Exceeding this returns a 429 rate-limit error, and your workflow pauses. If you're sending cold emails to 1,000 prospects, you'll need to split across two days or use a different sending method.

IMAP (Most Flexible for Reading) If you use Outlook, Yahoo, or a custom domain email, IMAP is your best bet. It lets n8n connect to any mail server that supports IMAP. Configuration: n8n asks for your email address, password, and IMAP server details (usually mail.yourdomain.com and port 993).

Drawback: IMAP is read-only in most cases. You can receive emails and trigger workflows, but to send, you'll need SMTP or Gmail. Also, IMAP is slower than OAuth2 for large inboxes--n8n has to sync the entire folder.

SMTP/SES (Best for High-Volume Sending) SMTP is the protocol for sending emails. Amazon SES (Simple Email Service) is a popular SMTP backend: it handles 50,000 emails per day without throttling (after a warm-up period). Configure n8n with your SES credentials, and n8n sends via SES instead of Gmail.

Cost: SES charges $0.10 per 1,000 emails sent, so 50,000 daily emails cost $5. Combined with n8n hosting, your total automation cost stays under $50/month.

Drawback: You must verify your sending domain and recipient addresses in SES to avoid errors. SES also has reputation-tracking; if too many emails bounce, your sending limit drops temporarily.

Building an AI Email Triage Workflow (Inbound Example)

Here's a step-by-step walkthrough of the most popular n8n email pattern: automatically sorting incoming emails using AI.

What This Workflow Does Every time a new email arrives in your inbox, n8n reads it, sends the subject and body to OpenAI's GPT model, and classifies it as "Sales," "Support," or "Spam." n8n then applies the matching Gmail label (or triggers a Slack alert). Result: your inbox is auto-sorted without you moving a finger.

Step 1: Add Gmail IMAP Trigger Add a Gmail node set to trigger on "New Email." Configure it to poll every 5 minutes. Set the folder to "Inbox" and configure output to include subject, sender, body, and date.

Step 2: Add OpenAI Node Add an "OpenAI" node (or "ChatGPT" in older n8n versions). Set the model to GPT-4 or GPT-3.5-turbo (3.5 is cheaper). Write a prompt:

Classify this email: Subject: {{ $json.body.subject }} From: {{ $json.body.from }} Body: {{ $json.body.body }}

Respond with ONLY one word: Sales, Support, or Spam.

The {{ }} syntax is n8n's template language--it inserts the actual email content.

Step 3: Add a Conditional Node Add an "IF" node to branch based on the LLM's classification. If the response is "Sales," route to the sales label; if "Support," route to the support label; if "Spam," archive it.

Step 4: Add Label Nodes Add Gmail label nodes for each branch. Configure them to apply the matching label to the original email.

Step 5: Optional--Add Slack Alert If you want real-time notification of "Sales" emails, add a Slack node at the end of the Sales branch. It will send a message like "New sales inquiry from john@acme.com: [subject]."

Step 6: Test and Deploy Send yourself a test email with "Sales opportunity" in the subject. Trigger the workflow. If everything works, activate it. n8n will now auto-sort every incoming email.

Cost: OpenAI charges ~$0.001 per email classified (GPT-3.5), so 100 daily emails cost roughly $0.10. With n8n's $25/month hosting, your total is about $28/month for unlimited inbox auto-sorting.

Sending Personalized Emails at Scale (Outbound Example)

Cold outreach with personalization is where n8n truly shines. Here's how to send 100+ personalized emails daily without hitting spam filters or Gmail limits.

The Pattern Load leads from a Google Sheet, enrich each lead with custom data, generate a personalized email body for each using LLM, send via Gmail or SMTP with delays, track sends in a database to prevent duplicates, and log opens/clicks if possible.

Step 1: Load Leads from Google Sheets Add a "Google Sheets" node set to "Read Rows." Point it to your leads spreadsheet (name, email, company, role columns). This pulls all rows into n8n's workflow.

Step 2: Loop Through Each Lead Add a "Loop" node. This repeats the following steps for each lead in the sheet. Without a loop, n8n would send 100 emails instantly and trigger Gmail's rate limit immediately.

Step 3: Generate Personalized Copy Inside the loop, add an OpenAI node with a prompt like:

Write a professional cold email subject and body. Recipient: {{ $json.name }}, {{ $json.role }} at {{ $json.company }} Recent activity: {{ $json.recent_activity }} Your offering: AI email automation

Keep it under 100 words. Make it specific to their company.

The LLM generates a unique email for each prospect, mentioning their company name and role. This dramatically improves open rates over generic templates.

Step 4: Add a Delay Node Add a "Sleep" node inside the loop, set to 5-15 seconds (randomized to avoid Gmail's pattern-detection algorithm). This slows the send rate and keeps your domain reputation clean.

Step 5: Send via Gmail or SMTP Add a Gmail or SMTP node. Set the recipient to {{ $json.email }}, subject to the LLM-generated subject, and body to the LLM-generated body.

Step 6: Log to Database (Deduplication) Add a database node (e.g., PostgreSQL, Airtable) to log every send: recipient email, timestamp, subject. Next time you run this workflow, the first step queries the database to skip anyone already contacted.

Step 7: Run It Activate the workflow. It will send 100 emails over ~1,000 seconds (~17 minutes). Gmail's rate limit is 500/day, so you have headroom. If you need to send 1,000 daily, split the workflow into two runs (morning and evening) or switch to SES.

Result: Personalized cold outreach at scale, legally compliant (each email can include an unsubscribe link), and tracked in your own database.

Email Deliverability and Rate Limits: What You Need to Know

Sending at scale in n8n introduces three new constraints: provider rate limits, spam folder risk, and legal compliance.

Gmail Rate Limits Most Gmail accounts are capped at 500 emails per day via the API. This isn't a hard technical limit--Google monitors sending patterns and enforces it. If you exceed 500, Gmail returns a 429 error and your workflow pauses.

Workaround: Use SMTP/SES instead of Gmail for sending. SES allows 50,000 emails/day after a warm-up period (you start at 200/day and request an increase). Cost: $0.10 per 1,000 emails, so 500 daily = $0.05.

Avoiding Spam Folders When you send at scale, ISPs (Gmail, Outlook, Yahoo) scrutinize your sender reputation. Here's what matters:

SPF/DKIM/DMARC records: Configure these DNS records on your sending domain. They prove you own the domain and prevent spoofing. n8n's docs include a setup guide.

List hygiene: Only send to valid, opted-in addresses. Invalid addresses bounce and hurt your reputation.

Engagement: Monitor open rates and click rates. If 30% of recipients mark you as spam, ISPs will start filtering you.

Unsubscribe links: CAN-SPAM (US) and GDPR (EU) legally require an unsubscribe link in every email. n8n can auto-append this.

Compliance: CAN-SPAM, GDPR, CASL CAN-SPAM (US): Include your business address, honor unsubscribe requests within 10 days, don't use deceptive subject lines.

GDPR (EU): You must have explicit opt-in consent before sending. No purchased lists. Offer an unsubscribe link. Respect "right to be forgotten."

CASL (Canada): Similar to GDPR--opt-in required.

n8n doesn't enforce these automatically; you do. Add an unsubscribe link to every email, log opt-outs, and filter them from future sends.

Monitoring Delivery n8n shows you send status (success, bounce, error) in the workflow logs. If 50+ emails bounce, investigate: are your addresses valid? Is your domain reputation damaged?

For deeper insight, integrate with Mailgun or SendGrid. These services provide bounce tracking, open tracking, and reputation scoring. Cost: $0-50/month depending on volume.

Troubleshooting Common Issues

OAuth2 Token Expiration Gmail OAuth2 tokens expire after 3-6 months. When this happens, your workflow will error on the Gmail node. Fix: Go to n8n's Credentials panel, find your Gmail credential, and click "Reconnect." Approve access again. n8n auto-renews going forward.

Rate Limit 429 Errors You're hitting Gmail's 500/day limit or SES's warm-up limit. Solution: Add a Sleep node with a longer delay (30-60 seconds), or split your workflow into multiple scheduled runs (e.g., 250 emails at 8 AM, 250 at 5 PM).

Email Bounces Recipient addresses are invalid or don't exist. n8n shows these in the workflow output. Remove them from your list before the next run, or add a validation step: query a database to skip known invalid addresses.

Workflow Timeout Large batches (1,000+ emails) can exceed n8n's execution timeout, especially on the free tier. Solution: Split into smaller batches (100-200 per run) or upgrade to a paid plan with longer timeouts.

Debug Mode Use n8n's Debug button (play icon) to test a single workflow run without sending real emails. This is essential before activating. You'll see the data flow through each node and catch configuration errors.

Next Steps: Hosting Your Workflow and Going Further

Once your workflow is live, you face a choice: keep it running locally (requires your laptop always on) or move to hosted n8n.

Local Deployment Trade-Offs Pros: Free, full data privacy, no ongoing cost. Cons: Workflows stop when your machine shuts down, no auto-restart if the process crashes, manual updates.

Managed Hosting Opsily's managed n8n hosting ensures workflows run 24/7. You get automatic backups, security patches, and 99.9% uptime. Useful when email workflows are revenue-critical (e.g., sales sequences, follow-up reminders).

For teams with just one or two workflows, local n8n works fine. For anything business-critical or multi-team, managed hosting is worth the cost.

You can also explore n8n's template library (9,000+ community workflows). Search "email" and you'll find pre-built examples: AI classification, cold outreach, follow-up sequences. Many are free; some require integration setup.

Frequently Asked Questions

What specific email providers does n8n integrate with? n8n directly integrates Gmail (OAuth2), Microsoft Outlook/Exchange, Yahoo, and any provider with IMAP/SMTP support. That covers 99% of users. Some providers like ProtonMail require workarounds (using third-party bridges), but n8n's community usually has solutions documented.

Can I trigger workflows based on email content, not just arrival? Yes. Use a Conditional node after your email trigger to filter based on subject, sender, or body keywords. Example: only process emails from domains ending in @acme.com. Only trigger if subject contains "urgent."

How do I test a workflow without sending real emails? Use n8n's Debug mode (play button). It executes the workflow once and shows you the data flow. No emails are sent unless you explicitly press Debug on a Send node. Always test before activating.

What's the cost of n8n email automation? n8n.cloud is free up to 5 workflows/month. Paid plans start at $25/month per user for unlimited workflows. If you're sending at scale via SES, add ~$0.10 per 1,000 emails. Total for a small team: $50-100/month.

Can I combine multiple email providers in one workflow? Yes. Send a portion of leads via Gmail, another via SES, based on a Conditional node. Or read from Gmail inbox, process, and send via SES. Mix and match as needed.

How do I handle unsubscribe requests automatically? When someone clicks the unsubscribe link in your email, they're directed to a form or webhook. n8n listens for this webhook, captures their email, and writes it to a database. Future sends filter out unsubscribed addresses.

What happens if my workflow crashes during a send? Partial sends are possible (100 out of 200 emails sent before crash). The workflow output shows which ones succeeded. On retry, your deduplication logic prevents resending to recipients already contacted. For mission-critical workflows, use managed hosting for auto-restart.

Is n8n self-hosted or cloud-only? Both. n8n.cloud is managed SaaS. n8n is also open-source (210.9K GitHub stars) and can run on your own server or VPS. Choose based on your privacy and cost preferences.

The Bottom Line

n8n's low-code design makes email automation accessible to non-technical founders and ops leads. The three patterns--inbox AI triage, personalized outreach, and scheduled follow-ups--cover 80% of real-world use cases. You can build your first workflow in an afternoon.

The key: start simple. Test inbox triage with a single LLM classification, then layer in outbound sending once you understand n8n's trigger-action model. Email deliverability takes practice, but following SPF/DKIM setup and rate limits keeps your domain clean.

Explore Opsily's managed n8n hosting to run your email workflows reliably without server maintenance.

Run Email Workflows 24/7 Reliably
Opsily's managed n8n hosting keeps your automation running without server maintenance or downtime.
Get Started Free

Ready to self-host your own apps?

One server. Multiple apps. No per-app fees.

Get started →