Templates / Classify and draft Gmail replies with OpenRouter and a Google Docs RAG KB

Classify and draft Gmail replies with OpenRouter and a Google Docs RAG KB

Ready for 3.0

by Mustafa Kamran · 5 views · created 2026-07-24 · Ticket Management, AI RAG

Ready 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.

  1. Retrieve Gmail Email (Gmail): get
  2. Email Classification Agent (AI Agent): runs an AI agent, with model: OpenRouter Model Classify
  3. Route Email Decision (Switch): routes items into 3 branches
  4. Create Reply with AI (AI Agent): runs an AI agent, with model: OpenRouter Model for Reply; 1 tool (Get Knowledge for Reply)
  5. Draft New Email with AI (AI Agent): runs an AI agent, with model: OpenRouter Model Email Draft; 1 tool (Fetch Knowledge Base Data)
  6. Send Reply Email (Gmail): reply
  7. Send Email for Review (Gmail): work with draft

Services it uses

GmailGoogle DocsOpenRouter Chat Model

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)

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…

Excerpt from Mustafa Kamran's description on n8n.io.

View the original on n8n.io → Check your own copy

Get the weekly “what broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.