Templates / Draft Gmail replies with OpenAI and OpenRouter for an inbox-zero workflow

Draft Gmail replies with OpenAI and OpenRouter for an inbox-zero workflow

Needs changes

by Zac Nielsen · 198 views · created 2026-02-04 · Ticket Management, AI RAG

Needs 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 this workflow does

This AI workflow has 15 nodes and runs on Gmail events. Along the way it connects Gmail, OpenAI Chat Model, Vector Store Question Answer and Embeddings OpenAI and 3 more.

How it runs

Trigger: On Gmail events.

  1. Set Content (Edit Fields (Set)): sets 3 fields: emailBody, threadID, from
  2. Client/Prospect Related? (Basic LLM Chain): sends a prompt to an LLM, with model: OpenRouter Chat Model; output parser: Structured Output Parser
  3. Customer Support? (Switch): routes items into 2 branches
  4. Email Draft Agent (AI Agent): runs an AI agent, with model: OpenAI Chat Model; 2 tools (createDraft, Vector Store Tool)
  5. Response Not Customer Support (Telegram): uses Telegram
  6. Response (Telegram): uses Telegram

Services it uses

GmailOpenAI Chat ModelVector Store Question AnswerEmbeddings OpenAITelegramOpenRouter Chat ModelSupabase Vector Store

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 Email Draft Agent (v1.7): 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).
  • Also check Always Output Data on multi-output nodes (If/Switch) now adds an empty item only when every output is empty.

Rather not rewrite it? Many of these flows can be rebuilt in Make (free plan).

Removed in 3.0Replace 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.

Nodes used (13)

From the author

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…

Excerpt from Zac Nielsen'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.