Templates / Draft and approve Gmail replies with OpenAI, Cognee, Slack, and Google Sheets

Draft and approve Gmail replies with OpenAI, Cognee, Slack, and Google Sheets

Needs changes

by Rahul Joshi ✓ · 17 views · created 2026-09-24 · 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 to replace before upgrading

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

Worth a look

Community nodes

These come from third-party npm packages. In n8n 3.0 unverified community packages are off by default (N8N_UNVERIFIED_PACKAGES_ENABLED=false).

Nodes used (13)

SlackGoogle SheetsGmailBasic LLM ChainOpenAI Chat ModelStructured Output ParserAI Agent

What it does

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 approvals to Google Sheets. How it works 1. Triggers every minute when a new email arrives in the Gmail INBOX. 2. Filters out automated senders (for example no-reply and mailer-daemon addresses) to skip unnecessary processing. 3. Uses OpenAI (gpt-4o-mini) to classify the email as needing a human reply or not. 4. For emails that need a reply, uses an OpenAI agent (gpt-4o-mini) with Cognee search to retrieve relevant company context and draft a response. 5. Creates a Gmail draft reply in the same thread and posts a preview to Slack for approve/reject decision. 6. Logs the approval status, timestamp, sender, subject, and draft text to Google Sheets. 7. If any step fails, formats the error details and sends an alert to Slack. Setup 1. Connect Gmail OAuth2 credentials and choose the mailbox/label to monitor, then ensure draft creation has access to the same Gmail account. 2. Add an OpenAI API credential for the classifier and drafting agent, and ensure the gpt-4o-mini model is available to your account. 3. Add a Cognee API credential and set the Cognee dataset used for search (for example cognee3rdworkflowdataset). 4. Connect Slack credentials and set the target Slack channel ID for approval requests and the channel for error alerts. 5. Connect Google Sheets OAuth2 credentials, then set the spreadsheet/document ID and sheet name and ensure the sheet has columns for Timestamp, From, Subject, Draft, and Approval Status.

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.