Build the "hands" of your n8n AI email assistant—four branches that reply, draft, notify, and tidy your inbox. Faster SLAs, lower costs, and 24/7 coverage.

n8n AI Email Assistant: Build the Action Workflows
If Part 1 was the brain, this is the muscle. In this n8n tutorial, you'll build the "hands" of your n8n AI email assistant—four action branches that automatically respond, draft, notify, and tidy your inbox using no-code AI. With November's inbox surge around launches and holiday promos, a reliable AI email assistant is the fastest way to protect response times and capture more leads.
This guide shows how to turn a text classifier's intent into concrete Gmail automation. You'll wire up Customer Support auto-replies, High Priority draft creation with threadId, Finance/Billing notifications that don't burn AI tokens, and a Promotions clean-up flow. By the end, you'll activate the workflow to run 24/7 with safeguards, logging, and KPIs to prove ROI.
Why your inbox needs "hands" right now
- Buyers expect near-instant replies, even after hours. An n8n AI email assistant shortens time-to-first-response without adding headcount.
- Q4 and holiday season create volume spikes. Automation preserves SLA while your team focuses on high-value conversations.
- Lead capture suffers when follow-ups are slow. Smart branching keeps hot prospects in the same email thread so nothing slips through.
The goal: Let AI handle the repetitive 60–80% while humans focus on nuance and negotiation.
Architecture: from classifier to action branches
Assume you have a classifier step that sets something like items[0].json.intent to one of: support, priority, finance, promotion. Now you'll translate intent into action.
Core nodes
Gmail Trigger(or polling Gmail): Watches for new messages in your chosen label/inbox.SwitchorIF: Routes items byintentfrom your AI classifier.LLM(or Chat node): Generates replies when needed.Set: Shapes data into clean fields for downstream nodes.Gmail(action): Sends replies, creates drafts, forwards messages, or modifies labels.- Optional:
Code,Rate Limit,Error Trigger, and logging nodes for resiliency.
Data you'll carry forward
from,to,subject,snippetorbodyTextmessageIdandthreadId(critical for staying in the same conversation)intent(classifier output)priorityScore(optional numeric ranking)
Keep the item payload tidy by normalizing fields with a Set node right after the trigger.
Implement the four action branches (the "hands")
1) Customer Support: auto-send a helpful reply
Best for FAQs, how-tos, and product questions where your knowledge base is solid.
Steps:
- In your
Switch, routeintent == "support". - Add an
LLMnode with a prompt like:- "You are a helpful customer support agent. Answer concisely in 120–180 words. Use the customer's language and include one actionable step. If unsure, ask one clarifying question. Keep the tone friendly and professional."
- Provide context via variables:
lastMessage,productName,helpCenterSummary.
- Add a
Gmailnode set toReplyorSendand include:to: original sendersubject:RE: {{ $json.subject }}threadId:{{$json.threadId}}to keep it in the same threadbody: LLM output
- Add a
Setnode to apply a label likeAI-Sentfor later analytics.
Guardrails:
- Include an
IFnode that blocks sending if the LLM returns low confidence (e.g.,contains(output, "I am not sure")). - Add a
Rate Limitnode to respect provider quotas.
2) High Priority: the pro move—create a draft in-thread
Use this when the stakes are high (enterprise leads, escalations). You want speed, but also human oversight.
Steps:
- Route
intent == "priority"orpriorityScore >= 0.8. - Generate a response draft with an
LLMnode. Prompt example:- "Draft a confident, concise reply for a high-priority lead. Acknowledge their request, propose next steps, and ask a single closing question to advance the deal. Limit to 6–8 sentences."
- Add
Gmailwith actionCreate Draft:to: original sendersubject:RE: {{ $json.subject }}threadId:{{$json.threadId}}body: LLM output
- Add a label like
Needs-Reviewand optionally notify your team with an internal email (no AI needed) summarizing the context.
Why threadId matters:
- Keeps history intact for the recipient
- Prevents duplicate or confusing subject lines
- Makes it effortless for a human to open the draft and hit send
3) Finance/Billing: notify the team, save AI credits
Invoices, receipts, refunds, or payment failures often don't need generative AI. Create a concise, structured ping your finance team can act on immediately.
Steps:
- Route
intent == "finance"or use rules likecontains(bodyText, "invoice"). - Use
Set(or aCodenode) to extract key values: invoice number, amount, due date, company name. Even a basic regex beats a long AI call here. GmailactionSendto your finance group address:- Subject:
Billing Signal: {{companyName}} — {{invoiceNumber}} - Body:
- Customer:
{{companyName}} - Topic:
{{extractedTopic}} - Amount/Due:
{{amount}}by{{dueDate}} - Original sender and a link to the thread (or include
threadIdreference for internal searching)
- Customer:
- Subject:
- Apply labels:
Billing,Routed.
Why skip AI here:
- Deterministic parsing lowers cost and latency
- Sensitive data stays out of model prompts when not required
4) Promotions: mark as read and file away
Sweep low-value promos and newsletters so your focus stays on customers and pipeline.
Steps:
- Route
intent == "promotion". GmailactionModify Message:- Mark as
Read - Add label
Promotions(create once if needed)
- Mark as
- Apply an archive step or move to your desired label folder.
Add a weekly clean-up job that deletes items older than 30–60 days under this label to keep storage tidy.
Activate, safeguard, and run 24/7
Turn it on
- In n8n, set your workflow to
Active. If usingGmail Trigger, confirm the polling interval and starting label. - Configure environment variables for API keys and system prompts so you can rotate them without editing nodes.
Add safety rails
- Content filters:
IFnode blocks replies containing profanity, PII leakage, or banned phrases. - Business-hour rules: For auto-sends, optionally restrict to set hours; outside hours, create drafts instead.
- Escalation fallback: On LLM error or timeout, send a human notification with the original message and thread context.
- Rate limiting: Use
Rate Limitto prevent spikes from tripping provider quotas.
Log everything
- Log per-email fields:
intent, action taken, response time, token usage, confidence score, and final outcome (sent,drafted,routed,archived). - Store logs in your preferred destination (sheet, database, or data warehouse) for reporting.
Measure ROI and iterate like a pro
Key metrics to watch:
- Time-to-first-response (TTFR)
- Auto-resolve rate (support emails solved without a human)
- Draft-to-send latency (for high priority)
- Lead conversion rate from email-originated inquiries
- Token cost per resolved email
Practical optimization ideas:
- A/B test support prompts for clarity and tone; keep the winner.
- Maintain a short library of reusable response snippets for LLM grounding.
- Expand intents gradually (e.g.,
sales-demo,feature-request) and map them to new branches. - Add a "confidence gate": If model confidence < X, draft instead of auto-send.
- Introduce a "VIP allowlist" that always routes to the High Priority branch.
Quick build checklist
- Classifier produces
intentreliably (and optionallyconfidence) - All emails carry
threadIdandmessageIdforward - Four branches wired: Support (Send), Priority (Create Draft), Finance (Notify), Promotions (Mark Read + File)
- Safety: filters, rate limits, escalation path
- Observability: logs, labels, and dashboards
- Workflow set to
Activeand tested end-to-end
Conclusion: your n8n AI email assistant is ready
With these action workflows, your n8n AI email assistant moves from smart sorting to tangible outcomes: instant support replies, review-ready drafts for top leads, frictionless finance notifications, and a calmer inbox. That means faster SLAs, more conversions, and a team focused on work that actually requires human judgment.
If you're ready to level up, start by activating the four branches and the threadId-based draft flow today. Then add guardrails, logging, and KPIs to prove impact. What's the next intent you'll automate to make your assistant even more capable?