Draft grounded Gmail support replies from a Notion KB with Groq and Cohere

Go to Workflow
1 views
Built by Kevin Yu Kevin Yu
Created on July 29, 2026

Description

Quick Overview
This workflow ingests published Notion knowledge base articles into an in-memory vector store using Cohere embeddings, then monitors a support Gmail inbox and uses Groq to draft grounded reply emails based only on retrieved KB sources, saving the result as a Gmail draft for review.

How it works
Manually runs an ingestion flow that pulls all pages from a Notion database and keeps only articles marked as Published.
Fetches each article’s Notion page blocks, assembles them into a single document, splits the text into chunks, and embeds the chunks with Cohere.
Clears and loads the resulting embeddings and metadata into an in-memory vector store for retrieval.
Triggers when an unread Gmail message arrives matching the support inbox query and normalizes the subject, body, sender, and thread details.
Uses Groq to classify the email as a support question, noise, or already resolved, and continues only for real support questions.
Embeds the question with Cohere, retrieves and reranks the most relevant KB chunks, and stops if the best match does not meet the configured relevance threshold.
Uses Groq to draft a reply using only the retrieved sources and, if an answer is produced, saves a Gmail draft reply that includes a list of the referenced KB articles.

Setup
Add credentials for Notion, Gmail, Groq, and Cohere in n8n.
Replace the Notion database ID in the Notion “Get KB Articles” step and ensure your database has fields that map to a status value of “Published” and article title/content.
Update the Gmail trigger query (for example, the target support address) and ensure the workflow has permission to create drafts in the mailbox.
Run the ingestion trigger once to build the in-memory vector store, and re-run it after n8n restarts or whenever your KB changes.

Nodes Used (11)

Basic LLM Chain
@n8n/n8n-nodes-langchain.chainLlm
Code
n8n-nodes-base.code
Default Data Loader
@n8n/n8n-nodes-langchain.documentDefaultDataLoader
Embeddings Cohere
@n8n/n8n-nodes-langchain.embeddingsCohere
Gmail
n8n-nodes-base.gmail
Groq Chat Model
@n8n/n8n-nodes-langchain.lmChatGroq
Notion
n8n-nodes-base.notion
Recursive Character Text Splitter
@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter
Reranker Cohere
@n8n/n8n-nodes-langchain.rerankerCohere
Simple Vector Store
@n8n/n8n-nodes-langchain.vectorStoreInMemory
Text Classifier
@n8n/n8n-nodes-langchain.textClassifier