Adaptive email auto-responder with GPT-4, RAG and human feedback loop
Needs changesWhat this workflow does
This AI workflow has 29 nodes and runs on Gmail events (plus 1 other trigger). Along the way it connects Embeddings OpenAI, Supabase Vector Store, OpenAI Chat Model and Google Sheets and 1 more.
How it runs
Trigger: On Gmail events (plus 1 other trigger).
- If: checks a condition and branches into true / false
- If: checks a condition and branches into true / false
- Get Dynamic Prompt (Google Sheets): uses Google Sheets
- Get Dynamic Prompt (Google Sheets): uses Google Sheets
- Original Reply (Markdown): converts between Markdown and HTML
- Information Extractor: extracts structured fields from text with AI, with model: OpenAI Chat Model
- Edit Fields (Edit Fields (Set)): sets or maps fields
- Markdown: converts between Markdown and HTML
- Switch: routes items into branches
- AI Agent: runs an AI agent, with model: OpenAI Chat Model; 1 tool (Supabase Vector Store); output parser: Auto-fixing Output Parser
…plus 7 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
1 thing in this workflow is removed in n8n 3.0. Fix it before you upgrade:
- AI Agent v1 (old agent modes) in AI Agent (v1.8): replace with Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent.
- Also check Gmail Trigger below v1.4 runs as v1.4 (drafts skipped, max emails per poll).
Rather not rewrite it? Many of these flows can be rebuilt in Make (free plan).
Published 2025 — 19% of 2025 templates need changes for 3.0. See how template age affects 3.0 readiness →
| Removed in 3.0 | Replace with |
|---|---|
| AI Agent v1 (old agent modes) AI Agent (v1.8) | Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent. |
Nodes used (17)
- Embeddings OpenAI
@n8n/n8n-nodes-langchain.embeddingsOpenAi - Supabase Vector Store
@n8n/n8n-nodes-langchain.vectorStoreSupabase - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - AI Agent
@n8n/n8n-nodes-langchain.agent - Auto-fixing Output Parser
@n8n/n8n-nodes-langchain.outputParserAutofixing - Structured Output Parser
@n8n/n8n-nodes-langchain.outputParserStructured - If
n8n-nodes-base.if - Google Sheets
n8n-nodes-base.googleSheets - Edit Fields (Set)
n8n-nodes-base.set - Gmail
n8n-nodes-base.gmail - Markdown
n8n-nodes-base.markdown - Google Sheets Trigger
n8n-nodes-base.googleSheetsTrigger - Information Extractor
@n8n/n8n-nodes-langchain.informationExtractor - Switch
n8n-nodes-base.switch - Default Data Loader
@n8n/n8n-nodes-langchain.documentDefaultDataLoader - Recursive Character Text Splitter
@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter - Gmail Trigger
n8n-nodes-base.gmailTrigger
From the author
⚙️ Self Learning Agent: AI-Powered Email Auto-Responder that Improves with Feedback 🧑💻 Author: LeeWei --- Overview of the n8n Workflow This n8n workflow builds a self-improving AI agent for handling email responses. It integrates Gmail for incoming…