Effortless Email Management with AI n8n Workflow Template

n8n workflow template · 22 nodes · Email (IMAP)

Effortless Email Management with AI is a free n8n workflow template that starts when a new email arrives over IMAP and works with Email (IMAP), Email (SMTP), Qdrant, OpenAI, Gmail and Google Drive and more. It has 22 nodes, 12 of them AI nodes (Qdrant Vector Store, OpenAI Embeddings, Summarization Chain and AI Agent). The notes inside the workflow say: “This workflow automates the handling of incoming emails, summarizes their content, generates appropriate responses using a retrieval-augmented generation (RAG) approach, and obtains approval or suggestions before sending replies.” To run it, you add your own credentials for Deep Seek API, Gmail OAuth2, Google Drive OAuth2, HTTP Header Auth and IMAP and others.

At a glance

Trigger
Email Trigger (IMAP) (Email Trigger (IMAP))
Nodes
22
Apps
Email (IMAP), Email (SMTP), Qdrant, OpenAI, Gmail, Google Drive and DeepSeek
AI nodes
12
Credentials
8 types
Category
RAG, documents and vector search

Apps and integrations

  • Email (IMAP)
  • Email (SMTP)
  • Qdrant
  • OpenAI
  • Gmail
  • Google Drive
  • DeepSeek

Node types used

  • Email Trigger (IMAP)
  • Markdown
  • Send Email
  • Qdrant Vector Store
  • OpenAI Embeddings
  • Summarization Chain
  • AI Agent
  • OpenAI Chat Model
  • Gmail
  • Text Classifier
  • Edit Fields (Set)
  • Manual Trigger
  • HTTP Request
  • Google Drive
  • Default Data Loader
  • Token Splitter
  • DeepSeek Chat Model

How it works

The text below comes from the sticky notes inside the workflow. We removed links, code samples and anything that looks like a key or token.

STEP 3 - MAIN FLOW

How it works

This workflow automates the handling of incoming emails, summarizes their content, generates appropriate responses using a retrieval-augmented generation (RAG) approach, and obtains approval or suggestions before sending replies.

You can quickly integrate Gmail and Outlook via the appropriate trigger nodes

Convert email to Markdown format for better understanding of LLM models

Chain that summarizes the received email

STEP 2

Documents vectorization with Qdrant and Google Drive

Agent that retrieves business information from a vector database and processes the response

STEP 1

Create Qdrant Collection

IMPORTANT

For the "Send Draft" node, you need to send the draft email to a Gmail address because it is the only one that allows the "Send and wait for response" function.

Based on the suggestion received, the text classifier can understand whether the feedback received approves the generated email or not.

The Email Reviewer agent, taking inspiration from human feedback, rewrites the email

Nodes in this workflow

The 22 nodes in file order (sticky notes excluded). Branches and connections determine execution order in n8n:

  1. Email Trigger (IMAP) (Email Trigger (IMAP))
  2. Markdown (Markdown)
  3. Send Email (Send Email)
  4. Qdrant Vector Store (Qdrant Vector Store)
  5. Embeddings OpenAI (OpenAI Embeddings)
  6. Email Summarization Chain (Summarization Chain)
  7. Write email (AI Agent)
  8. OpenAI (OpenAI Chat Model)
  9. Gmail (Gmail)
  10. Text Classifier (Text Classifier)
  11. Edit Fields (Edit Fields (Set))
  12. When clicking ‘Test workflow’ (Manual Trigger)
  13. Create collection (HTTP Request)
  14. Refresh collection (HTTP Request)
  15. Get folder (Google Drive)
  16. Download Files (Google Drive)
  17. Default Data Loader (Default Data Loader)
  18. Token Splitter (Token Splitter)
  19. Qdrant Vector Store1 (Qdrant Vector Store)
  20. Embeddings OpenAI1 (OpenAI Embeddings)
  21. DeepSeek Chat Model (DeepSeek Chat Model)
  22. Email Reviewer (AI Agent)

Credentials you need

  • Deep Seek API – used by DeepSeek Chat Model
  • Gmail OAuth2 – used by Gmail
  • Google Drive OAuth2 – used by Download Files and Get folder
  • HTTP Header Auth – used by Create collection and Refresh collection
  • IMAP – used by Email Trigger (IMAP)
  • OpenAI API – used by Embeddings OpenAI, Embeddings OpenAI1 and OpenAI
  • Qdrant API – used by Qdrant Vector Store and Qdrant Vector Store1
  • SMTP – used by Send Email

Configure your own credentials after importing. Create each credential in n8n, then select it in the node.

How to import into n8n

  1. Download the JSON file with the button above.
  2. In n8n, open a new workflow, select the ... menu and choose Import from File. You can also paste the JSON straight into the editor canvas.
  3. Open each node that shows a warning and select or create its credential.
  4. Read the notes on the canvas, test the workflow with sample data, then activate it.

Do you need somewhere to run it? Read our guide to self-hosted n8n.

Need this customised?

We can adapt this workflow to your apps, data and process, then deploy and support it.

Contact Us