AutomationMart
Home/Browse/Gmail assistant with full Gmail history RAG using OpenAI
n8n

Gmail assistant with full Gmail history RAG using OpenAI

n8nn8n20 modulesv1.0
GmailSlackDiscordOpenAI

RAG with Full Gmail history + Real time email updates in RAG using OpenAI & Qdrant > Summary: > This workflow listens for new Gmail messages, extracts and cleans email content, generates embeddings via OpenAI, stores them in a Qdrant vector database, and then enables a Retrieval‑Augmented‑Generation (RAG) agent to answer user queries against those stored emails. It’s designed for teams or bots that need conversational access to past emails. --- 🧑‍🤝‍🧑 Who’s it for - Support teams who want

At a glance

Gmail assistant with full Gmail history RAG using OpenAI is a ready-made n8n workflow you import as a workflow JSON file — no build required. It connects Gmail, Slack, Discord, OpenAI. It's free to download. Follow the 5-step import below to go live in minutes.

Platform
n8n
Connects
Gmail, Slack, Discord, OpenAI
Modules
20
Price
Free
Version
v1.0
Gmail assistant with full Gmail history RAG using OpenAI workflow diagram

About this workflow

RAG with Full Gmail history + Real time email updates in RAG using OpenAI & Qdrant > Summary: > This workflow listens for new Gmail messages, extracts and cleans email content, generates embeddings via OpenAI, stores them in a Qdrant vector database, and then enables a Retrieval‑Augmented‑Generation (RAG) agent to answer user queries against those stored emails. It’s designed for teams or bots that need conversational access to past emails. --- 🧑‍🤝‍🧑 Who’s it for - Support teams who want to surface past customer emails in chatbots or help‑desk portals - Sales ops that need AI‑powered summaries and quick lookup of email histories - Developers building RAG agents over email archives --- ⚙️ How it works / What it does 1. Trigger - Gmail Trigger polls every minute for new messages. 2. Fetch & Clean - Get Mail Data pulls full message metadata and body. - Code node normalizes the body (removes line breaks, collapses spaces). 3. Embed & Store - Embeddings OpenAI node computes vector embeddings. - Qdrant Vector Store inserts embeddings + metadata into the emailshistory collection. 4. Batch Processing - SplitInBatches handles large inbox loads in chunks of 50. 5. RAG Interaction - When chat message received → RAG Agent → uses Qdrant Email Vector Store as a tool to retrieve relevant email snippets before responding. 6. Memory - Simple Memory buffer ensures the agent retains recent context. --- 🛠️ How to set up 1. n8n Instance - Deploy n8n (self‑hosted or via Coolify/Docker). 2. Credentials - Create an OAuth2 credential in n8n for Gmail (with Gmail API scopes). - Add your OpenAI API key in n8n credentials. 3. Qdrant - Stand up a Qdrant instance (self‑hosted or Qdrant Cloud). - Note your host, port, and API key (if any). 4. Import Workflow - In n8n, go to Workflows → Import → paste the JSON you provided. - Ensure each credential reference (Gmail & OpenAI) matches your n8n credential IDs. 5. Test - Click Execute Workflow or send a test email to your Gmail. - Monitor n8n logs: you should see new points in Qdrant and RAG responses. --- 📋 Requirements - n8n (Self-hosted or Cloud) - Gmail API enabled on a Google Cloud project - OpenAI API access (with Embedding & Chat endpoints) - Qdrant (hosted or cloud) with a collection named emailshistory --- 🎨 How to customize the workflow - Change Collection Name - Update the qdrantCollection.value in all Qdrant nodes if you prefer a different collection. - Adjust Polling Frequency - In the Gmail Trigger node, switch from everyMinute to everyFiveMinutes or a webhook‑style trigger. - Metadata Tags - In Enhanced Default Data Loader, tweak the metadataValues to tag by folder, label, or sender domain. - Batch Size - In SplitInBatches, change batchSize to suit your inbox volume. - RAG Agent Prompt - Customize the systemMessage in the RAG Agent node to set the assistant’s tone, instruct on date handling, or add additional tools. - Additional Tools - Chain other n8n nodes (e.g., Slack, Discord) after the RAG Agent to broadcast AI answers to team channels.

n8n

How to import this n8n workflow

  1. 1

    Download the workflow JSON file after purchase.

  2. 2

    Open n8n → click the menu → Import from File.

  3. 3

    Select the downloaded JSON and import.

  4. 4

    Set up credentials for each node that requires them.

  5. 5

    Click Execute Workflow to test, then activate.

Setup guide

Setup guide included

Purchase to unlock the full step-by-step guide

Related N8n workflows

Upload Gmail attachment to Docparser

When an e-mail that has an attachment which meets specified criteria is received, that attachment is uploaded to Docparser.

Free

Automate marketing leads import from Google Sheets to Airtable CRM

General Principles This workflow automates the import of leads into the Company table of a CRM built with Airtable. Its originality lies in leveraging the new "Data Table" node (an internal table within n8n) to generate an execution report. 📚 Why Data Tables: This approach eliminates the need for reading/writing operations on a Google Sheet file or an external database. 🧩 It is structured on 3 main key steps: 1. Reading leads for w

Free

Generate 100+ ad variations from one image with Fal.AI Nano Banana and GPT-5

Scale Your Creative Strategy: 100+ Creative Ads from 1 Image using Fal.AI, Nano Banana model and GPT-5.1 This workflow turns a single reference image into up to 100 high-performing ad variations using Fal.AI's Nano Banana model and GPT-5.1. Simply upload your inspiration to a form, and watch as unique, campaign-ready images appear in your Google Drive. Why use this? Scale Instantly: Turn one idea into a full campaign without manual design work. Smart Variations: Uses GPT-5.1 to analyze your re

Free

Post Discord messages for new Incidents in ilert

Every time a new Incident is received in your iLert account, Integromat will automatically post it on your Discord server.

Free

Facebook Campaign Data to Airtable & Slack Integration

Automate the consolidation of your Facebook campaign data into Airtable and share updates seamlessly on Slack. Set for weekly updates, you can easily customize the schedule to match your campaign cycles. This integration empowers marketers to quickly adapt strategies based on real-time insights and collaborative feedback.

Free

Send Slack messages when a new track is added to a Spotify playlist

Retrieve the new tracks added to Spotify playlist and post a Slack message.

Free

Generate UGC promo videos with OpenAI, Sora 2 and Blotato for eCommerce

Generate UGC Promo Videos with Blotato and Sora 2 for eCommerce 🧩 Who is this for? This workflow is perfect for eCommerce brands, content creators, and marketing teams who want to automatically generate short, eye-catching videos from their product images — without editing software or manual work. 🚀 What problem does this workflow solve? Creating engaging promotional videos manually can be time-consuming and expensive.

Free

Generate and send AI news newsletters automatically with GPT & Gmail

Description: Automate your AI newsletter creation and delivery using this ready-to-deploy n8n workflow template. Powered by GPT (OpenAI/Azure) and integrated with Gmail, this workflow generates rich, structured, and engaging AI-focused newsletters and sends them out daily or weekly—completely hands-free. What It Does: - 📰 Fetches the latest AI trends and updates using GPT - ✍️ Automatically formats news into structured newsletter sections: headlines, tools, stats, tips, and more - 📧 S

Free

Reviews

No reviews yet

Be the first to buy and share your experience.

Leave a review

Sign in to share your experience with this workflow.

Log in to review
Free
No ratings yet

Create a free account to purchase workflows.

  • JSON blueprint — instant download
  • Setup guide PDF included
  • 5 downloads · valid 30 days
  • Works with n8n

Need help setting this up?

Book a 3-hour live setup session with an Agility consultant.

₹2,499/ session
3 hrs · video call
  • Configure live on Google Meet / Zoom
  • Free follow-up if workflow has defects
  • Platform expert assigned to you
Book installation session
Free