Draft and approve Gmail replies with OpenAI, Cognee, Slack, and Google Sheets
Needs changesWhat this workflow does
This AI workflow has 20 nodes and runs on Gmail events (plus 1 other trigger). Along the way it connects Slack, Google Sheets, Gmail and OpenAI Chat Model and 1 more.
How it runs
Trigger: On Gmail events (plus 1 other trigger).
- Is Automated Sender? (If): checks a condition and branches into true / false
- Format Error Message (Edit Fields (Set)): sets 4 fields: errorMessage, failedNode, workflowName…
- Classify: Needs Reply? (Basic LLM Chain): sends a prompt to an LLM, with model: OpenAI Chat Model; output parser: Reply Classification Schema
- Notify Error in Slack (Slack): uses Slack
- Needs a Reply? (If): checks a condition and branches into true / false
- Draft Reply Agent (AI Agent): runs an AI agent, with model: OpenAI Chat Model; 1 tool (Search Company Brain (Cognee))
- Create Gmail Draft (Gmail): work with draft
- Request Approval in Slack (Slack): send and wait for a reply
- Approved? (If): checks a condition and branches into true / false
- Mark Approved (Edit Fields (Set)): sets 5 fields: timestamp, from, subject…
…plus 2 more steps. See the full node list below.
Services it uses
Other Google Sheets + Gmail templates (2,102) · Other OpenAI + Google Sheets templates (2,011) · Other OpenAI + Gmail templates (1,623)
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 Draft Reply Agent (v1.9): 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).
Rather not rewrite it? Many of these flows can be rebuilt in Make (free plan).
Published 2026 — 6% of 2026 templates need changes for 3.0. See how template age affects 3.0 readiness →
| Removed in 3.0 | Replace with |
|---|---|
| AI Agent v1 (old agent modes) Draft Reply Agent (v1.9) | Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent. |
Nodes used (13)
- Slack
n8n-nodes-base.slack - If
n8n-nodes-base.if - Edit Fields (Set)
n8n-nodes-base.set - Google Sheets
n8n-nodes-base.googleSheets - Gmail Trigger
n8n-nodes-base.gmailTrigger - No Operation, do nothing
n8n-nodes-base.noOp - Basic LLM Chain
@n8n/n8n-nodes-langchain.chainLlm - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - Structured Output Parser
@n8n/n8n-nodes-langchain.outputParserStructured - Cognee Tool
n8n-nodes-cognee.cogneeTool - Gmail
n8n-nodes-base.gmail - AI Agent
@n8n/n8n-nodes-langchain.agent - Error Trigger
n8n-nodes-base.errorTrigger
From the author
Quick overview This workflow monitors a Gmail inbox for new messages, uses OpenAI to decide whether a reply is needed, drafts grounded replies with a Cognee knowledge base, saves them as Gmail drafts, and requests human approval in Slack while logging…