Triage and draft Gmail support replies with Stripe, GPT-4.1, and Slack
Needs changesNeeds 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.0 | Replace with |
|---|---|
| AI Agent v1 (old agent modes) AI Draft Customer Reply (v1.7), AI Draft Non-Customer Reply (v1.7) | Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent. |
Worth a look
- Gmail Trigger below v1.4 runs as v1.4 (drafts skipped, max emails per poll) (When Email Sent via Gmail)
Nodes used (14)
- Loop Over Items (Split in Batches)
n8n-nodes-base.splitInBatches - HTTP Request
n8n-nodes-base.httpRequest - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - Structured Output Parser
@n8n/n8n-nodes-langchain.outputParserStructured - AI Agent
@n8n/n8n-nodes-langchain.agent - Stripe
n8n-nodes-base.stripe - Gmail
n8n-nodes-base.gmail - Code
n8n-nodes-base.code - If
n8n-nodes-base.if - Slack
n8n-nodes-base.slack - Filter
n8n-nodes-base.filter - Edit Fields (Set)
n8n-nodes-base.set - Gmail Trigger
n8n-nodes-base.gmailTrigger - Google Docs
n8n-nodes-base.googleDocs
What it does
Quick Overview This workflow polls Gmail for new inbox emails, looks up the sender in Stripe to classify them as a customer or non-customer, uses OpenAI plus Google Docs playbooks to draft a reply, and posts the draft to Slack for human review while sending an immediate confirmation email. How it works 1. Triggers every minute when new emails arrive in Gmail and processes only messages labeled INBOX. 2. Retrieves the full Gmail message and its thread history, then formats a transcript and counts prior exchanges for escalation context. 3. Parses the sender name/email and searches Stripe for a matching customer record. 4. Fetches the appropriate Google Docs support playbook, builds a confirmation email, and sends the acknowledgement via the Gmail API. 5. Uses OpenAI (GPT-4.1-mini) to generate a structured JSON draft reply (intent, sentiment, escalation flags, and HTML email body) using the email content, thread context, and (if available) Stripe customer details. 6. Creates a Gmail draft reply in the original thread and converts the HTML draft into Slack mrkdwn. 7. Posts the draft, classification, and escalation notes to a configured Slack channel for approval. Setup 1. Connect credentials for Gmail (Gmail Trigger and Gmail draft/thread nodes) and Google OAuth2 for the Gmail API send requests. 2. Add Stripe API credentials and ensure the workflow can query customers by email. 3. Add Google Docs OAuth2 credentials and replace BOTH playbook document URLs with your Google Doc IDs. 4. Add an OpenAI API key (or replace the OpenAI chat model nodes with your preferred provider). 5. Add Slack credentials and replace BOTH Slack channel IDs with the channel where reviewers should receive draft notifications. 6. Update the Settings values (company name, support from-address, support email addresses list, SLA text, and escalation threshold) to match your support setup.