Block 1 - OpenAI Chat Model
- Type / Role
- @n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
- Config choices
- Version 1.3
Analyze, classify, and summarize emails using RAG (automatic taxonomy learning) This workflow automatically reads incoming Gmail messages, analyzes them using AI with a retrieval augm...
@n8n/n8n-nodes-langchain.lmchatopenai, n8n-nodes-base.gmailtrigger, n8n-nodes-base.googlesheets, n8n-nodes-base.stickynote, n8n-nodes-base.manualtrigger, @n8n/n8n-nodes-langchain.agent, n8n-nodes-base.gmail, n8n-nodes-base.set
This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Amirhosein Zahedi.
Original n8n.io sourceThis workflow automatically reads incoming Gmail messages, analyzes them using AI with a retrieval-augmented classification system (RAG), organizes emails into structured categories, stores results in Google Sheets, and even generates an audio summary sent directly to Telegram.
The workflow creates an intelligent email processing pipeline combining Gmail, OpenAI, vector embeddings, and Google Sheets to continuously learn and improve email categorization accuracy.
The agent strictly prioritizes retrieved taxonomy examples to maintain consistent labeling.
Create the following credentials inside n8n:
Sheet 1 β Email Log
Sheet 2 β Tagging Samples (Knowledge Base)
This sheet acts as the classification training reference used by the vector store.
chatId value with your Telegram user or group IDThis workflow uses a Retrieval-Augmented Generation (RAG) pattern inside n8n by combining Google Sheets as a lightweight knowledge base with an in-memory vector store. Instead of relying purely on model reasoning, classification decisions are grounded in previously approved examples, producing stable and explainable categorization.
Over time, the workflow becomes smarter as new categories are automatically added, effectively turning your inbox into a continuously learning AI system.
This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.
Showing the first 24 of 29 workflow blocks. Download the JSON for the full node graph.
| Workflow | Analyze, classify, and summarize Gmail with OpenAI RAG and Google Sheets |
|---|---|
| Complexity | advanced |
| Nodes | 29 |
| Categories | Ticket Management, AI RAG |
| Author | Amirhosein Zahedi |
| Published | 21 Feb 2026 |
Use the JSON export at /data/workflows/13568/13568.json as the source template for this automation.
Open n8n, import the downloaded JSON, and review each node before activating the workflow.
Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.
Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.
Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.
Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.
Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.
Analyze, classify, and summarize emails using RAG (automatic taxonomy learning) This workflow automatically reads incoming Gmail messages, analyzes them using AI with a retrieval augm...
Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.
Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Ticket Management, AI RAG use case.