AI Email Processing Workflow with Approval via n8n Automation

This n8n workflow automates handling incoming emails by summarizing content, generating AI-driven responses, and sending replies only after explicit approval. It saves time and ensures professional, context-aware email replies using AI and vector databases.
emailReadImap
lmChatOpenAi
gmail
+7
Learn how to Build this Workflow with AI:
Workflow Identifier: 1311
NODES in Use: emailReadImap, markdown, lmChatOpenAi, emailSend, vectorStoreQdrant, embeddingsOpenAi, chainSummarization, set, if, gmail

Press CTRL+F5 if the workflow didn't load.

Visit through Desktop for Best experience

1. Opening Problem Statement

Meet Luca, a customer service manager at a growing software company. Every day, his support inbox floods with dozens, sometimes hundreds, of emails asking for product information, troubleshooting, or business inquiries. Manually reading, summarizing, and drafting responses is tedious and error-prone, often causing delays and inconsistent replies. More importantly, sending messages without manager approval risks miscommunication and legal issues. Luca needs an automated way to efficiently process incoming emails, draft professional answers based on company knowledge, and get approval before replying—to save hours daily and improve customer experience.

2. What This Automation Does

This n8n workflow is designed precisely for professionals like Luca. Here’s how it works when triggered by a new email:

  • Automatically read incoming emails from IMAP corporate inbox.
  • Convert email content into Markdown format for better AI comprehension.
  • Summarize the email using an AI summarization chain to focus on key points.
  • Augment response formulation using a vector store (Qdrant) linked to company knowledge documents for factual accuracy.
  • Generate a professional, concise AI-written draft reply in HTML format based on summary and retrieved info.
  • Send the draft to a designated Gmail account for manual approval via a “Yes/No” interface.
  • Upon approval, automatically send the response back to the original sender.

This eliminates hours of manual editing, reduces errors, and keeps communication consistent and professional while maintaining control through the approval step.

3. Prerequisites ⚙️

  • 📧 Corporate email with IMAP access (e.g., [email protected])
  • 📧 Gmail account for receiving and approving draft emails
  • 🔑 OpenAI API key for AI language models and embeddings
  • 🔑 Qdrant Vector Database account for company knowledge retrieval
  • ⏱️ Active n8n instance (cloud or self-hosted)
  • Optional: Self-hosting n8n, e.g. via Hostinger

4. Step-by-Step Guide

Step 1: Set up Email Trigger (IMAP)

Go to the n8n editor, click + Add Node, search for “Email Trigger (IMAP)” node. Configure the node by selecting your IMAP credentials for your corporate inbox (e.g., [email protected]). This node continuously listens for new emails.

Expected: When a new email arrives, this node captures the email content and metadata.

Common mistake: Forgetting to properly set IMAP server settings or credentials leads to no triggers.

Step 2: Convert Email to Markdown

Add the Markdown node. Link it to Email Trigger output. Configure it to convert the incoming email’s HTML body (use expression {{$json.textHtml}}) into Markdown. This helps AI better understand the content.

Visual: You should see the Markdown node output a cleaner, text-based version of the email.

Common mistake: Feeding the wrong input field will cause malformed markdown.

Step 3: Summarize Email Content with AI Chain

Add the Email Summarization Chain node. Connect it to the Markdown node output. Enter the prompt to summarize the email in max 100 words, e.g., “Write a concise summary of the following in max 100 words.” This uses AI to highlight key message points.

Expected: The node returns a short summary to facilitate response accuracy.

Common mistake: Not setting binary data keys correctly causes failed summarization.

Step 4: Store & Query Company Knowledge with Embeddings & Qdrant

Set up the Embeddings OpenAI node to convert the summarized or relevant text into vector embeddings for semantic search. Then connect to the Qdrant Vector Store node that retrieves matching data from your company’s knowledge base collection, described as “Extracts information regarding the request made.” Ensure API credentials for both OpenAI and Qdrant are configured.

Common mistake: Using mismatched or empty collections in Qdrant leads to no useful retrievals.

Step 5: Generate AI-Powered Reply Email

Add the Write email agent node. Feed it with the summary and the retrieved knowledge base output. Configure its system message carefully to instruct generation of a professional, concise email reply in HTML format, max 100 words.

Expected: Node outputs the email body, ready for review.

Common mistake: Incorrect prompt formatting or system message leads to irrelevant or informal replies.

Step 6: Send Draft for Approval via Gmail

Add the Send Draft Gmail node. Configure it to send the AI-generated email draft to a designated Gmail address for manual approval. Use the “Send and wait for response” operation with approval buttons enabled (Yes/No).

Important: Gmail is required here because only Gmail offers the “send and wait for approval” feature in n8n.

Visual: You’ll see the draft email appears in Gmail inbox with approval buttons.

Common mistake: Using other email services breaks the approval feature.

Step 7: Approval Decision Node

Add the Approve? If node to evaluate the manual approver’s choice from the Gmail response. The condition checks if data.approved == true.

Expected: If approved, the workflow proceeds to send the final email; if not, it stops or logs.

Step 8: Send Final Approved Email

Use the Send Email node configured with SMTP credentials for your corporate email. It takes the AI-generated response and the original email’s subject & recipient and sends out the approved reply automatically.

Expected: Recipient receives a timely, accurate email reply.

Common mistake: Mismatched “to” and “from” fields can lead to delivery failure.

5. Customizations ✏️

Customize the AI model: Change the “DeepSeek R1” or “OpenAI” nodes to use other models (GPT-4, GPT-3.5) by editing the model parameter to suit your company size or budget.

Adjust summary length: In the “Email Summarization Chain” node, tweak the summary prompt for longer or shorter summaries as needed.

Expand knowledge base: Add more documents to your Qdrant vector database to improve AI context and response relevance.

Change approval process: Modify the “Send Draft” node’s Gmail address to a different reviewer or integrate Slack approvals instead (requires additional nodes).

6. Troubleshooting 🔧

Problem: “No emails triggered”
Cause: IMAP credentials incorrect or inbox misconfigured.
Solution: Verify IMAP server settings, login credentials in the Email Trigger node.

Problem: “AI fails to summarize or generate response”
Cause: Missing or incorrect API keys for OpenAI or malformed input.
Solution: Confirm API key validity, check node input expressions, retry.

Problem: “Draft email approval buttons not appearing”
Cause: Using non-Gmail sending node.
Solution: Use Gmail node with OAuth2 credentials as specified.

7. Pre-Production Checklist ✅

  • Check IMAP credentials and test email triggering
  • Verify OpenAI and Qdrant API keys and connectivity
  • Test markdown conversion and summarization accuracy
  • Confirm Gmail OAuth2 credentials and approval email receipt
  • Run end-to-end test with sample email and approval flow

8. Deployment Guide

Once you’ve double-checked all settings, activate the workflow in n8n by toggling it to Active. The Email Trigger will listen continuously for new messages. Enable error notifications in n8n to monitor failures. For business use, schedule regular backups of your Qdrant knowledge base and credentials.

9. FAQs

Q: Can I replace Qdrant with other vector databases?
A: Yes, but you’ll need to modify the vector retrieval nodes accordingly. Qdrant is used here for easy integration.

Q: Does this workflow consume significant OpenAI API credits?
A: Usage depends on email volume and response complexity. Optimize prompts to reduce token consumption.

Q: Is my email data secure?
A: This workflow runs within your controlled n8n environment. Secure your credentials and use encrypted connections.

10. Conclusion

By following this tutorial, you’ve built a powerful n8n automation that reads incoming corporate emails, summarizes them, leverages AI and vector search to draft professional replies, and only sends responses once approved. This saves Luca—and you—hours every day, reduces human error, and maintains communication quality.
Consider expanding this workflow with multilingual support, Slack or Microsoft Teams notifications on approvals, or connections to CRM systems for further automation.

Related Workflows

Automate Viral UGC Video Creation Using n8n + Degaus (Beginner-Friendly Guide)

Learn how to automate viral UGC video creation using n8n, AI prompts, and Degaus. This beginner-friendly guide shows how to import, configure, and run the workflow without technical complexity.
Form Trigger
Google Sheets
Gmail
+37
Free

AI SEO Blog Writer Automation in n8n (Beginner Guide)

A complete beginner guide to building an AI-powered SEO blog writer automation using n8n.
AI Agent
Google Sheets
httpRequest
+5
Free

Automate CrowdStrike Alerts with VirusTotal, Jira & Slack

This workflow automates processing of CrowdStrike detections by enriching threat data via VirusTotal, creating Jira tickets for incident tracking, and notifying teams on Slack for quick response. Save hours daily by transforming complex threat data into actionable alerts effortlessly.
scheduleTrigger
httpRequest
jira
+5
Free

Automate Telegram Invoices to Notion with AI Summaries & Reports

Save hours on financial tracking by automating invoice extraction from Telegram photos to Notion using Google Gemini AI. This workflow extracts data, records transactions, and generates detailed spending reports with charts sent on schedule via Telegram.
lmChatGoogleGemini
telegramTrigger
notion
+9
Free

Automate Email Replies with n8n and AI-Powered Summarization

Save hours managing your inbox with this n8n workflow that uses IMAP email triggers, AI summarization, and vector search to draft concise replies requiring minimal review. Automate business email processing efficiently with AI guidance and Gmail integration.
emailReadImap
vectorStoreQdrant
emailSend
+12
Free

Automate Email Campaigns Using n8n with Gmail & Google Sheets

This n8n workflow automates personalized email outreach campaigns by integrating Gmail and Google Sheets, saving hours of manual follow-up work and reducing errors in email sequences. It ensures timely follow-ups based on previous email interactions, optimizing communication efficiency.
googleSheets
gmail
code
+5
Free