Draft Gmail replies with OpenAI and OpenRouter for an inbox-zero workflow
Needs changesNeeds changes. This template uses 1 thing(s) that n8n 3.0 removes: AI Agent v1 (old agent modes). 1 breaking item(s) found. Static check, last run 2026-10-19.
What to replace before upgrading
| Removed in 3.0 | Replace with |
|---|---|
| AI Agent v1 (old agent modes) Email Draft Agent (v1.7) | Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent. |
Worth a look
- Gmail Trigger below v1.4 runs as v1.4 (drafts skipped, max emails per poll) (Gmail Trigger)
- Always Output Data on multi-output nodes (If/Switch) now adds an empty item only when every output is empty (Customer Support?)
Nodes used (13)
- Gmail Trigger
n8n-nodes-base.gmailTrigger - Edit Fields (Set)
n8n-nodes-base.set - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - Vector Store Question Answer Tool
@n8n/n8n-nodes-langchain.toolVectorStore - Embeddings OpenAI
@n8n/n8n-nodes-langchain.embeddingsOpenAi - Gmail Tool
n8n-nodes-base.gmailTool - Telegram
n8n-nodes-base.telegram - Switch
n8n-nodes-base.switch - OpenRouter Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenRouter - Structured Output Parser
@n8n/n8n-nodes-langchain.outputParserStructured - Basic LLM Chain
@n8n/n8n-nodes-langchain.chainLlm - Supabase Vector Store
@n8n/n8n-nodes-langchain.vectorStoreSupabase - AI Agent
@n8n/n8n-nodes-langchain.agent
What it does
Automatically draft email replies using AI. This workflow monitors your Gmail inbox, filters out automated emails (newsletters, receipts, notifications), and uses AI to create draft responses only for emails that genuinely need your attention. Who is this for? Freelancers, consultants, and business owners who want to reduce email response time while maintaining quality responses. How it works 1. Gmail Trigger polls your inbox for new emails 2. AI Classification (OpenRouter) determines if the email needs a human response - automatically filters out newsletters, receipts, system notifications, and marketing emails 3. Email Draft Agent (OpenAI) generates a contextual draft reply matching your writing style 4. Gmail saves the draft to your drafts folder 5. Telegram sends you a notification when drafts are created Prerequisites - Gmail account with OAuth2 access - OpenAI API key - OpenRouter API key - Telegram bot token and chat ID - (Optional) Supabase account for vector store Setup steps 1. Import the workflow and connect your Gmail OAuth2 credentials 2. Add your OpenAI and OpenRouter API keys 3. Create a Telegram bot via BotFather and add your chat ID to the notification nodes 4. Customise the Email Draft Agent system prompt with your business context and example emails 5. Test with a few emails before activating