Mindket

Email replies with Gmail approval and a knowledge base

Newversion 1 · updated

Overview

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 . Download it on this page or copy its JSON, then import it into an n8n canvas. Nothing runs until you activate it in n8n.

At a glance

Runs in
  • 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

Platform

Connects 7 apps

How it works

Trigger

A new email

It starts when a new unread email arrives in the IMAP mailbox, and it reads:

  • The sender, the subject and the HTML or plain text of the email

Actions

  1. Once, by hand, a Google Drive folder is read, split into pieces of 300 tokens and stored in a Qdrant collection
  2. The HTML of the email is turned into Markdown and DeepSeek summarizes it in at most 100 words
  3. An agent searches the Qdrant collection and writes a reply of under 100 words from the summary
  4. Gmail sends the draft to an approver and the run waits for a typed answer
  5. A classifier reads the answer as approved or declined
  6. An approved reply is sent by SMTP to the original sender, and a declined one is rewritten from the feedback and sent for approval again

Result

A reply to the original sender that a person approved, written from your own documents

Integrations

What you need before you start.

Email (IMAP)

Mail trigger

Watches a mailbox and passes on each new unread email with its sender, subject and text.

NeedsThe IMAP host, a user and a password or app password

DeepSeek

Summary model

Summarizes the email text in at most 100 words with deepseek-flash.

NeedsDeepSeek API key

Qdrant

Knowledge base

Stores the pieces of your documents as vectors and is searched by the agents for the facts behind a reply.

NeedsThe address of a Qdrant instance and an API key

OpenAI

Agents and embeddings

Embeds the documents and the searches, writes and rewrites the reply, and classifies the approver’s answer with gpt-5.6-terra.

NeedsOpenAI API key

Google Drive

Document source

Lists the files in a folder and downloads each one, Google Docs as plain text.

NeedsA Google Drive OAuth2 credential and the folder

Gmail

Approval

Sends the approver the original message and the draft, and waits for a typed answer.

NeedsA Gmail OAuth2 credential and the approver’s address

Email (SMTP)

Reply sender

Sends the approved reply to the sender of the incoming email.

NeedsSMTP host, user and password

Workflow check

Checked by Mindket on 13 Nov 2026

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

Read from the workflow’s file, not from a run.

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
IndustryWho uses itHow they use itExample
SupportSupport teamsDraft answers to common questions from the help documentsA support agent approves a reply about opening hours by typing Ok.
SalesSales teamsAnswer product and price questions from a shared folder of documentsA salesperson asks for a shorter reply, and the rewrite arrives in the next approval email.
ServicesSmall firmsReply to client questions with the firm’s own policy documentsAn office manager approves a reply that quotes the booking policy.
OperationsOffice managersRun a shared info inbox without writing each replyAn 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

Setup

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
NeedDetail
n8nAn account on n8n Cloud or a server of your own
QdrantThe address of your instance and an API key
OpenAIAn API key for the embeddings, the two agents and the classifier
DeepSeekAn API key for the summary
Google DriveA folder of Google Docs that answer the questions
MailboxIMAP details to read the mail and SMTP details to send the replies
GmailAn 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 changeWhere
Which documents it knowsThe folder in Get folder and the pieces in Token Splitter
How a reply readsThe system message of Write email
How a rewrite looksThe system message of Email Reviewer
What counts as approvalThe categories in Text Classifier
The length of the summaryThe two prompts in Email Summarization Chain
The modelsOpenAI and DeepSeek Chat Model
The approval emailGmail

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
NodeWhat it doesWhat to know
Email Summarization ChainSummarizes the email text with DeepSeek Chat Model in at most 100 wordsSet to read a binary file, and there is none, so the email reaches the model through the prompt, with its curly braces doubled
Write emailA tools agent on OpenAI with the Qdrant store as its toolThe tool is named company_knowladge_base, a spelling kept from the original
GmailSend and wait for response, with a free-text answerNo time limit is set, and the answer comes back as data.text
Text ClassifierReads data.text as Approved or DeclinedShares the OpenAI model with the two agents
Email ReviewerA tools agent that rewrites the draft as HTML from the feedbackIts output goes back to Gmail, so the loop runs until someone approves
Send EmailSMTP send of the approved HTMLThe from address is the to header of the incoming email
Refresh collectionHTTP Request to Qdrant’s delete points route with an empty filterQdrant’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 and files

README

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.
Files
NOTICE.md  646 B
README.md  9 KB
workflow.json  21 KB

3 files, 30 KB, downloaded as a zip.

What’s new

  • Version 1 · 2026-11-12

Reviews

No ratings yet

Write a review

No reviews yet.

More from Mindket

See all from Mindket

Huashu Design

alchaincyf · Skill

Turns a one-line request in your AI agent into a finished design: a launch animation, a clickable app prototype, an editable slide deck, an infographic or a se…

New29.4k

Guizang PPT Skill

op7418 · Skill

Skill that makes single-file HTML slide decks, slide illustrations and platform covers in two visual styles, with a presenter mode for rehearsal. For speakers…

New29.8k

Claude Code Skills & Plugins

alirezarezvani · Skill

Adds 411 ready-made skills for Claude Code and other coding agents, grouped by role from engineering and product to marketing, finance and compliance. Installs…

New29.8k

Similar in Productivity

See all in Productivity

Frontend Slides

zarazhangrui · Skill

Builds HTML presentations from scratch or from a PowerPoint file and shows visual style previews to pick from, for people who want web slides with no CSS or Ja…

New32.3k

IPTV

iptv-org · Kit

Collects publicly available live TV channels from many countries into playlists that any video player with live streaming can open. Made for viewers and for de…

New144k

upscaler

uwg · Kit

Holds a set of image upscaling models gathered from the OpenModelDB community, for people who want to enlarge low-resolution pictures with AI on their own comp…

New