Analyze, classify, and summarize Gmail with OpenAI RAG and Google Sheets
Ready for 3.0What this workflow does
This AI workflow has 20 nodes and runs on Gmail events (plus 1 other trigger). Along the way it connects OpenAI Chat Model, Gmail, Google Sheets and Telegram and 2 more.
How it runs
Trigger: On Gmail events (plus 1 other trigger).
- Fetch full Gmail message (Gmail): get
- Get row(s) in sheet (Google Sheets): uses Google Sheets
- Normalize email fields (Edit Fields (Set)): sets 6 fields: id, date, sender…
- Vector store — taxonomy index (Simple Vector Store): stores documents in the Simple vector store, with embeddings: Create embeddings (OpenAI); document loader: Prepare taxonomy documents
- Analyze email with RAG agent (AI Agent): runs an AI agent, with model: OpenAI Chat Model; 1 tool (Vector store retriever (RAG tool))
- Parse AI analysis result (Edit Fields (Set)): sets 12 fields: sender, email, date…
- Store processed email (Google Sheets): append
- Check for new taxonomy items (If): checks a condition and branches into true / false
- Load taxonomy dataset (Google Sheets): uses Google Sheets
- Generate audio summary (OpenAI): work with audio
…plus 4 more steps. See the full node list below.
Services it uses
Other Google Sheets + Gmail templates (2,102) · Other OpenAI + Google Sheets templates (2,011) · Other OpenAI + Gmail templates (1,623)
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
- Still check Gmail Trigger below v1.4 runs as v1.4 (drafts skipped, max emails per poll) (Gmail Trigger).
Nodes used (14)
- OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - Gmail Trigger
n8n-nodes-base.gmailTrigger - Google Sheets
n8n-nodes-base.googleSheets - Manual Trigger
n8n-nodes-base.manualTrigger - AI Agent
@n8n/n8n-nodes-langchain.agent - Gmail
n8n-nodes-base.gmail - Edit Fields (Set)
n8n-nodes-base.set - If
n8n-nodes-base.if - Code
n8n-nodes-base.code - Telegram
n8n-nodes-base.telegram - OpenAI
@n8n/n8n-nodes-langchain.openAi - Simple Vector Store
@n8n/n8n-nodes-langchain.vectorStoreInMemory - Default Data Loader
@n8n/n8n-nodes-langchain.documentDefaultDataLoader - Embeddings OpenAI
@n8n/n8n-nodes-langchain.embeddingsOpenAi
From the author
<h2📧 Analyze, classify, and summarize emails using RAG (automatic taxonomy learning)</h2 <p This workflow automatically reads incoming Gmail messages, analyzes them using AI with a retrieval-augmented classification system (RAG), organizes emails into…