Classify and draft Gmail replies with OpenRouter and a Google Docs RAG KB
Ready for 3.0Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-10-19.
What this workflow does
This AI workflow has 14 nodes and runs on Gmail events. Along the way it connects Gmail, Google Docs and OpenRouter Chat Model.
How it runs
Trigger: On Gmail events.
- Retrieve Gmail Email (Gmail): get
- Email Classification Agent (AI Agent): runs an AI agent, with model: OpenRouter Model Classify
- Route Email Decision (Switch): routes items into 3 branches
- Create Reply with AI (AI Agent): runs an AI agent, with model: OpenRouter Model for Reply; 1 tool (Get Knowledge for Reply)
- Draft New Email with AI (AI Agent): runs an AI agent, with model: OpenRouter Model Email Draft; 1 tool (Fetch Knowledge Base Data)
- Send Reply Email (Gmail): reply
- Send Email for Review (Gmail): work with draft
Services it uses
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) (When Gmail Receives Email).
Nodes used (7)
- Gmail
n8n-nodes-base.gmail - Gmail Trigger
n8n-nodes-base.gmailTrigger - No Operation, do nothing
n8n-nodes-base.noOp - Switch
n8n-nodes-base.switch - Google Docs Tool
n8n-nodes-base.googleDocsTool - AI Agent
@n8n/n8n-nodes-langchain.agent - OpenRouter Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenRouter
From the author
Quick overview This workflow monitors a Gmail inbox, uses OpenRouter (Qwen) to classify each incoming email, and either auto-replies, creates a Gmail draft for human review, or ignores the message, with Google Docs used as a knowledge base to ground the…