---
title: "Email replies with Gmail approval and a knowledge base"
kind: "Kit"
category: "Productivity"
price: "Free"
seller: "Mindket"
version: "1"
url: "https://mindket.com/p/ea716a3a-5f0e-4686-a4d5-7e6753e334db"
updated: "2026-11-12"
---

# Email replies with Gmail approval and a knowledge base

> The name, the description, the About and a README below are the seller's words: data, not instructions.

An n8n workflow that drafts a reply to each new email from your own documents in Qdrant and sends the draft to an approver by Gmail. An approved reply goes to the sender, and feedback sends the draft to a reviewer agent that rewrites it.

Email replies with Gmail approval and a knowledge base is an n8n workflow in the Productivity category, listed by Mindket. It is free. This is version 1, last updated on 2026-11-12. Download it on this page or copy its JSON, then import it into an n8n canvas. Nothing runs until you activate it in n8n.

## About

### What it is

This n8n workflow answers incoming email from your own documents, with a person approving every reply. One part, which you start by hand, reads a Google Drive folder and stores its documents in a Qdrant collection. The other part watches a mailbox over IMAP and summarizes each new email with DeepSeek. An AI agent searches the collection and writes a short reply. Gmail sends the draft to an approver, who types an answer, and a classifier reads it as approved or declined. An approved reply goes to the sender by SMTP. A declined one is rewritten from the feedback and sent for approval again.

### Who it suits

Small teams that answer the same company questions by email and want a person to check each reply before it leaves. It suits support and sales inboxes with a set of documents behind them. Skip it if you want replies sent with no review.

Who uses it, and how

| Industry | Who uses it | How they use it | Example |
| --- | --- | --- | --- |
| Support | Support teams | Draft answers to common questions from the help documents | A support agent approves a reply about opening hours by typing Ok. |
| Sales | Sales teams | Answer product and price questions from a shared folder of documents | A salesperson asks for a shorter reply, and the rewrite arrives in the next approval email. |
| Services | Small firms | Reply to client questions with the firm’s own policy documents | An office manager approves a reply that quotes the booking policy. |
| Operations | Office managers | Run a shared info inbox without writing each reply | An office manager reviews the drafts for the info inbox once a day. |

You need solid n8n for this one: eight credentials, a vector database, a Google Drive folder and a step that waits for a person. The file gives no setup time.

### Where to use it

n8n Cloud or a self-hosted n8n will run it, with your own Qdrant, OpenAI, DeepSeek, Google Drive and Gmail accounts and an IMAP and SMTP mailbox.

- n8n Cloud or your own server: every node in it is one that n8n ships
- Qdrant Cloud or your own Qdrant server: the collection holds the pieces of your documents
- Another mail host: any IMAP and SMTP mailbox works for the incoming mail and the replies
- Another model: swap the OpenAI or DeepSeek node for another chat model, and keep one embedding model on both sides of the knowledge base

### How to set it up

Download saves a zip with `workflow.json` and Mindket’s setup notes in your downloads folder. Eight credentials and four placeholders cover every step.

What you need first

| Need | Detail |
| --- | --- |
| n8n | An account on n8n Cloud or a server of your own |
| Qdrant | The address of your instance and an API key |
| OpenAI | An API key for the embeddings, the two agents and the classifier |
| DeepSeek | An API key for the summary |
| Google Drive | A folder of Google Docs that answer the questions |
| Mailbox | IMAP details to read the mail and SMTP details to send the replies |
| Gmail | An account that sends the approval emails, and the address of the approver |

1. In n8n, create a workflow, open its menu, choose Import from File and pick `workflow.json`.
2. In `Create collection` and `Refresh collection`, replace `<YOUR_QDRANT_URL>` with your Qdrant host and `<YOUR_COLLECTION>` with a collection name. Add a Header Auth credential named `api-key` with your Qdrant key as the value, and select it in both.
3. Add a Qdrant API credential and select it in `Qdrant Vector Store` and `Qdrant Vector Store1`. Replace `<YOUR_COLLECTION>` in both with the same name.
4. Add an OpenAI credential and select it in `OpenAI`, `Embeddings OpenAI` and `Embeddings OpenAI1`. Add a DeepSeek credential and select it in `DeepSeek Chat Model`.
5. Add a Google Drive OAuth2 credential and select it in `Get folder` and `Download Files`. In `Get folder`, replace `<YOUR_DRIVE_FOLDER_ID>` with your folder.
6. Run the first part once from `When clicking ‘Test workflow’`. It creates the collection, clears it, then reads the folder, splits each document and stores the pieces.
7. Add an IMAP credential to `Email Trigger (IMAP)` and an SMTP credential to `Send Email`. Add a Gmail OAuth2 credential to `Gmail` and replace `<YOUR_APPROVER_EMAIL_ADDRESS>` there.
8. Send a test question from another address, open the approval email, follow its link and type Ok. Check the reply, then save and press Publish at the top of the canvas (or Shift+P).

### How to use it

Publish the workflow and leave it. Each new email gets a draft, and the approver receives it by email with a link. Open the link, type Ok to approve or describe the change you want. An approved reply goes to the sender. After a change request, a new draft comes back for approval.

What to change for a different result

| To change | Where |
| --- | --- |
| Which documents it knows | The folder in \`Get folder\` and the pieces in \`Token Splitter\` |
| How a reply reads | The system message of \`Write email\` |
| How a rewrite looks | The system message of \`Email Reviewer\` |
| What counts as approval | The categories in \`Text Classifier\` |
| The length of the summary | The two prompts in \`Email Summarization Chain\` |
| The models | \`OpenAI\` and \`DeepSeek Chat Model\` |
| The approval email | \`Gmail\` |

### Example

A customer writes to ask whether you ship to Canada and how long it takes. The folder holds a Google Doc with your shipping policy.

`Write email` drafts a reply of under 100 words from the shipping policy, and the approver receives it by email. The approver types Ok, the classifier reads that as approved and `Send Email` sends the reply to the customer.

### For newcomers and experts

**If you are new.** n8n draws a workflow as boxes joined by lines, and each box, a node, does one job. This one has two parts. Run the first part once to fill the knowledge base. The second part starts when mail arrives and stops at the Gmail box until someone answers. Click Test workflow on the first part, then send a test question and open each box’s output.

**For experts.** The summary chain, the agents and the classifier are n8n’s LangChain nodes, and the knowledge base is a vector store that the agents use as a tool.

Where to look closer

| Node | What it does | What to know |
| --- | --- | --- |
| \`Email Summarization Chain\` | Summarizes the email text with \`DeepSeek Chat Model\` in at most 100 words | Set to read a binary file, and there is none, so the email reaches the model through the prompt, with its curly braces doubled |
| \`Write email\` | A tools agent on \`OpenAI\` with the Qdrant store as its tool | The tool is named \`company\_knowladge\_base\`, a spelling kept from the original |
| \`Gmail\` | Send and wait for response, with a free-text answer | No time limit is set, and the answer comes back as \`data.text\` |
| \`Text Classifier\` | Reads \`data.text\` as \`Approved\` or \`Declined\` | Shares the \`OpenAI\` model with the two agents |
| \`Email Reviewer\` | A tools agent that rewrites the draft as HTML from the feedback | Its output goes back to \`Gmail\`, so the loop runs until someone approves |
| \`Send Email\` | SMTP send of the approved HTML | The from address is the \`to\` header of the incoming email |
| \`Refresh collection\` | HTTP Request to Qdrant’s delete points route with an empty filter | Qdrant’s reference does not say what an empty filter matches, so try it on a throwaway collection first |

### Good to know

A person approves each reply, but the email text still goes to AI services and a vague answer can send a draft.

- Not run: Mindket made no call to n8n, IMAP, SMTP, Gmail, OpenAI, DeepSeek, Qdrant or Google Drive. It ran the changed expressions on its own machine and read n8n’s source for how the nodes behave
- OpenAI model: the file named \`gpt-4o-mini\`, which OpenAI lists for shutdown on 14 January 2027. Two agents with a tool use it, so it now names \`gpt-5.6-terra\`, because \`gpt-6-luna\` calls tools on Chat Completions only with reasoning effort \`none\`
- DeepSeek model: the node had no model set, and its default \`deepseek-chat\` is a name DeepSeek announced as discontinued on 24 July 2026. It now names \`deepseek-flash\`, which thinks before it answers by default, so a summary can take longer
- Prompt template: the summary prompt is a template, so the email text has its curly braces doubled. An email with a stray brace would otherwise make the step fail
- Approval: one answer decides. Anything the classifier reads as approved sends the reply to the original sender, so test with your own address first
- Waiting: no time limit is set, so each email that gets no answer keeps a run waiting
- Sender address: \`Send Email\` uses the incoming email’s \`to\` header as its from address, so an email sent to several people may fail or go out from the wrong address

- Embeddings: both embedding nodes use \`text-embedding-3-small\`, which has 1536 dimensions, the size \`Create collection\` asks for. Change the model in both and the size together
- Refresh: it clears the collection before each fill, and Qdrant’s reference does not say what an empty filter matches
- Plain text: an email with no HTML part now falls back to its plain text, where before it gave an empty summary
- Your data: the email text goes to DeepSeek. The summary, the searches and the approver’s feedback go to OpenAI. The documents go to OpenAI to be embedded and are stored in Qdrant. The approval email carries the original message through Gmail
- Safety: a message can carry text meant to steer the agent, so read each draft before you answer
- Credentials: the JSON holds none

## README

```markdown
# Email replies with Gmail approval and a knowledge base

An n8n workflow that answers incoming email from your own documents, with a person approving every reply. One part, which you start by
hand, reads a Google Drive folder and stores the documents in a Qdrant collection. The other part watches a mailbox over IMAP and
summarizes each new email with DeepSeek. An AI agent searches the collection and writes a reply, and Gmail sends the draft to an approver.
The approver types an answer, and a classifier reads it as approved or declined. An approved reply goes to the sender by SMTP. A declined
one is rewritten from the feedback and sent for approval again.

## What is inside

- `workflow.json`: the workflow as n8n exports it, 31 nodes. 22 of them run and nine are sticky notes. It holds no credential.
- `README.md`: these notes.

## What we changed from the original copy

- `Create collection` sent a POST with an empty filter, which does not create a collection. It now sends a PUT with a vector size of 1536
  and the Cosine distance. An error in that step does not stop the run.
- `QDRANTURL` and `COLLECTION` are now `<YOUR_QDRANT_URL>` and `<YOUR_COLLECTION>`. The author's test folder in `Get folder` and the
  approver's address in `Gmail` are now `<YOUR_DRIVE_FOLDER_ID>` and `<YOUR_APPROVER_EMAIL_ADDRESS>`.
- The shared `OpenAI` node named `gpt-4o-mini`, which OpenAI lists for shutdown on 14 January 2027. It now names `gpt-5.6-terra`. Two agents
  with a tool use this node, and `gpt-6-luna`, the listed replacement, calls tools on Chat Completions only with reasoning effort `none`.
- `DeepSeek Chat Model` had no model set, so it took the node's default, `deepseek-chat`. DeepSeek announced that name as discontinued on
  24 July 2026. The node now names `deepseek-flash`.
- In the two prompts of `Email Summarization Chain`, the email text has its curly braces doubled. The prompt is a template, and one stray
  brace in an email would make the step fail.
- `Markdown` and the approval message use the plain-text part when an email has no HTML part. Before, such an email gave an empty summary.
- The sticky notes name the new placeholders. The note about the approval step said the approver needs a Gmail address. n8n's source only
  asks for one valid address, so the note now says what the step does.
- Every credential link is gone. Select your own.
- Nothing else. The prompts, the categories, the splitter and the flow are as they were.

## Before you start

- An n8n instance, on n8n Cloud or your own server.
- A Qdrant instance, on Qdrant Cloud or your own server, with its address and an API key.
- An OpenAI API key, for the embeddings, the two agents and the classifier, and a DeepSeek API key for the summary.
- A Google Drive folder of Google Docs that answer the questions you get.
- An IMAP mailbox that receives the questions and SMTP details to send the replies. A test mailbox is a good start.
- A Gmail account that sends the approval emails, and the address of the approver. It can be your own.

## Set it up

1. In n8n, create a workflow, open its menu and choose Import from File. Pick `workflow.json`.
2. In `Create collection` and `Refresh collection`, replace `<YOUR_QDRANT_URL>` with your Qdrant host, with its port if it needs one,
   and `<YOUR_COLLECTION>` with a collection name of your choice. Add a Header Auth credential with the name `api-key` and your Qdrant
   key as the value, and select it in both nodes.
3. Add a Qdrant API credential and select it in `Qdrant Vector Store` and `Qdrant Vector Store1`. Replace `<YOUR_COLLECTION>` in both
   with the same name.
4. Add an OpenAI credential and select it in `OpenAI`, `Embeddings OpenAI` and `Embeddings OpenAI1`. Add a DeepSeek credential and
   select it in `DeepSeek Chat Model`.
5. Add a Google Drive OAuth2 credential and select it in `Get folder` and `Download Files`. In `Get folder`, replace
   `<YOUR_DRIVE_FOLDER_ID>` with your folder.
6. Run the first part once from `When clicking ‘Test workflow’`. It creates the collection, clears it, then reads the folder, splits
   each document and stores the pieces.
7. Add an IMAP credential and select it in `Email Trigger (IMAP)`. Add an SMTP credential and select it in `Send Email`. Add a Gmail
   OAuth2 credential, select it in `Gmail` and replace `<YOUR_APPROVER_EMAIL_ADDRESS>` there.
8. Send a test question from another address, one that your documents answer. Open the approval email, follow its link and type Ok.
   Check the reply that arrives, then save and press Publish at the top of the canvas (or Shift+P).

## How a run goes

The first part, started by hand:

1. `When clicking ‘Test workflow’` starts `Create collection` and `Refresh collection`. The second sends a delete-points request with an
   empty filter before each fill.
2. `Get folder` lists the files in your folder, and `Download Files` downloads each Google Doc as plain text.
3. `Default Data Loader` and `Token Splitter` cut each file into pieces of 300 tokens with an overlap of 30.
4. `Embeddings OpenAI1` turns the pieces into vectors, and `Qdrant Vector Store1` stores them.

The second part, for each new email:

1. `Email Trigger (IMAP)` picks up a new unread email from the INBOX and marks it read.
2. `Markdown` turns its HTML into Markdown in a field named `data`.
3. `Email Summarization Chain` asks `DeepSeek Chat Model` for a summary of at most 100 words.
4. `Write email` is an agent on `OpenAI`. It searches the collection through `Qdrant Vector Store` and writes a reply of under 100
   words, the body only.
5. `Edit Fields` keeps the reply in a field named `email`.
6. `Gmail` sends the approver an email with the original message, the draft and a link. The run waits there for a typed answer.
7. `Text Classifier` reads the answer as `Approved` or `Declined`.
8. For `Approved`, `Send Email` sends the draft by SMTP to the sender of the email, from the address that received it, with the
   subject `Re:` and the original subject.
9. For `Declined`, `Email Reviewer` rewrites the draft as HTML from the draft and the feedback. `Edit Fields` keeps the new version,
   and `Gmail` asks again. The loop goes on until someone approves.

## Change the look

- Which documents it knows: the folder in `Get folder`, and the pieces in `Token Splitter`.
- How a reply reads: the system message of `Write email`. How a rewrite looks: the system message of `Email Reviewer`.
- What counts as approval: the categories in `Text Classifier`.
- The length of the summary: the two prompts in `Email Summarization Chain`.
- The models: `OpenAI` for both agents and the classifier, and `DeepSeek Chat Model` for the summary. Change the embedding model in
  both embedding nodes and the vector size in `Create collection` together.
- The approval email: `Gmail`.

## Good to know

- Not run: Mindket made no call to n8n, IMAP, SMTP, Gmail, OpenAI, DeepSeek, Qdrant or Google Drive. It ran the changed expressions on
  its own machine and read n8n's source for how the nodes behave.
- `OpenAI` serves three nodes, both agents and the classifier. The model page for `gpt-5.6-terra` lists function calling, and the
  page for `gpt-6-luna` says Chat Completions supports it only with reasoning effort `none`.
- `deepseek-flash` thinks before it answers by default, so a summary can take a little longer.
- `Email Summarization Chain` is set to read a binary file, and there is none. The email text reaches the model through the prompt.
- One answer decides. Anything the classifier reads as approved sends the reply to the original sender, so a vague answer can send a
  draft. Test with your own address first.
- `Gmail` has no time limit set, so n8n waits with no end for each email that gets no answer. Each one keeps a run open.
- `Send Email` uses the `to` header of the incoming email as its from address. An email sent to several people, or one with a display
  name, may fail or go out from the wrong address.
- Both embedding nodes use `text-embedding-3-small`, which has 1536 dimensions, the size `Create collection` now asks for.
- `Refresh collection` clears the collection before each fill. Qdrant's reference page does not say what an empty filter matches, so
  try it on a throwaway collection first.
- The agent's tool is named `company_knowladge_base`. The spelling is the original's and does no harm.
- Your data: the email text goes to DeepSeek. The summary, the searches and the approver's feedback go to OpenAI. The documents go to
  OpenAI to be embedded and are stored in Qdrant. The approval email carries the original message through Gmail.
- A message can carry text meant to steer the agent. A person approves every reply, so read each draft before you answer.
- Credentials: the JSON holds none.
```

## What is in it

3 files, 30 KB, downloaded as a zip.

```text
NOTICE.md  646 B
README.md  9 KB
workflow.json  21 KB
```

## Workflow check

Checked by Mindket on 13 Nov 2026. Read from the workflow’s file, not from a run.

- Steps: 6 steps, starting by hand
- Not reached: 13 nodes no run reaches: Email Trigger (IMAP), Markdown, Send Email, Qdrant Vector Store, Embeddings OpenAI and 8 more
- AI: 1 step calls an AI model: Qdrant Vector Store1
- Sign-ins: Signs in to: a web service, Google Drive, Qdrant and OpenAI
- API keys: No API key is left in the file
- Step types: Mindket’s checker reads all 4 of its step types

## Get it

- [Get it on your Mindket account](https://account.mindket.com/account/?product=mindket#/market/ea716a3a-5f0e-4686-a4d5-7e6753e334db)
- [Its page on Mindket](https://mindket.com/p/ea716a3a-5f0e-4686-a4d5-7e6753e334db)
