Triage support emails and draft Gmail replies with OpenAI
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 11 nodes and runs on Gmail events. Along the way it connects Gmail, OpenAI Chat Model and Google Sheets.
How it runs
Trigger: On Gmail events.
- Triage Config (Edit Fields (Set)): sets 7 fields: Categories, EscalateCategories, IgnoreCategories…
- Classify Email (Basic LLM Chain): sends a prompt to an LLM, with model: OpenAI Chat Model
- Parse Classification (Code): runs custom JavaScript code
- Log Triage (Google Sheets): append
- Route By Outcome (Switch): routes items into 3 branches
- Draft Reply (Basic LLM Chain): sends a prompt to an LLM, with model: OpenAI Chat Model
- Escalate To Human (Gmail): uses Gmail
- Label As Ignored (Gmail): add labels
- Create Gmail Draft (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) (On New Email).
Nodes used (8)
- Gmail Trigger
n8n-nodes-base.gmailTrigger - Edit Fields (Set)
n8n-nodes-base.set - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - Basic LLM Chain
@n8n/n8n-nodes-langchain.chainLlm - Code
n8n-nodes-base.code - Google Sheets
n8n-nodes-base.googleSheets - Switch
n8n-nodes-base.switch - Gmail
n8n-nodes-base.gmail
From the author
Quick overview This workflow monitors Gmail for new messages, detects emails by subject keywords, uses OpenAI to draft a reply grounded only in your provided guidelines, and saves the response as a Gmail draft in the original thread for manual review. How it…