Draft grounded Gmail support replies from a Notion KB with Groq and Cohere
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.
Related Templates
AI Email Classifier & Auto-Delete for Gmail (SPAM/OFFER Cleaner)
This workflow is designed for freelancers, solopreneurs, and business owners who receive a high volume of irrelevant mes...
Generate Product Ad Copy & CTAs with GPT-4 for Slack and Airtable
⚡ AI Copywriter Pro: Instant Ad Copy & CTA Generator Transform product details into compelling marketing copy in second...
Auto-classify Gmail emails with AI and apply labels for inbox organization
Who is this for? Professionals and individuals who receive high volumes of emails, those who want to automatically organ...
🔒 Please log in to import templates to n8n and favorite templates
Workflow Visualization
Loading...
Preparing workflow renderer
Comments (0)
Login to post comments