AI Email processing autoresponder with approval (Yes/No) n8n Workflow Template

n8n workflow template · 12 nodes · Email (IMAP)

AI Email processing autoresponder with approval (Yes/No) is a free n8n workflow template that starts when a new email arrives over IMAP and works with Email (IMAP), OpenAI, Email (SMTP), Qdrant and Gmail. It has 12 nodes, 6 of them AI nodes (OpenAI Chat Model, Qdrant Vector Store, OpenAI Embeddings and Summarization Chain). The notes inside the workflow say: “Convert email to Markdown format for better understanding of LLM models” To run it, you add your own credentials for Gmail OAuth2, IMAP, OpenAI API, Qdrant API and SMTP.

At a glance

Trigger
Email Trigger (IMAP) (Email Trigger (IMAP))
Nodes
12
Apps
Email (IMAP), OpenAI, Email (SMTP), Qdrant and Gmail
AI nodes
6
Credentials
5 types
Category
RAG, documents and vector search

Apps and integrations

  • Email (IMAP)
  • OpenAI
  • Email (SMTP)
  • Qdrant
  • Gmail

Node types used

  • Email Trigger (IMAP)
  • Markdown
  • OpenAI Chat Model
  • Send Email
  • Qdrant Vector Store
  • OpenAI Embeddings
  • Summarization Chain
  • AI Agent
  • Edit Fields (Set)
  • If
  • Gmail

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.

Convert email to Markdown format for better understanding of LLM models

Chain that summarizes the received email

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

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.

Setup notes

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.

Main Flow

Preliminary step

Create a vector database on Qdrant and tokenize the documents useful for generating a response

How it works

This workflow is designed to automate the process of handling incoming emails, summarizing their content, generating appropriate responses with RAG, and obtaining approval (YES/NO button) before sending replies.

This workflow is designed to handle general inquiries that come in via corporate email via IMAP and generate responses using RAG. You can quickly integrate Gmail and Outlook via the appropriate trigger nodes

Nodes in this workflow

The 12 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. DeepSeek R1 (OpenAI Chat Model)
  4. Send Email (Send Email)
  5. Qdrant Vector Store (Qdrant Vector Store)
  6. Embeddings OpenAI (OpenAI Embeddings)
  7. Email Summarization Chain (Summarization Chain)
  8. Write email (AI Agent)
  9. OpenAI (OpenAI Chat Model)
  10. Set Email (Edit Fields (Set))
  11. Approve? (If)
  12. Send Draft (Gmail)

Credentials you need

  • Gmail OAuth2 – used by Send Draft
  • IMAP – used by Email Trigger (IMAP)
  • OpenAI API – used by DeepSeek R1, Embeddings OpenAI and OpenAI
  • Qdrant API – used by Qdrant Vector Store
  • 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