🔓 Unlock all 10,000+ workflows & prompts free Join Newsletter →
✅ Full access unlocked — explore all 10,000 AI workflow and prompt templates Browse Templates →
Home n8n Workflow
January 22, 2026

Gmail + OpenAI: replies drafted, you approve, sent

Lisa Granqvist Partner Workflow Automation Expert

Your inbox doesn’t get “busy.” It gets noisy. One missed customer email turns into a follow-up, then another, and suddenly you’re apologizing instead of moving work forward.

This hits founders and client-facing marketers hardest, honestly. But agency account managers feel it too, because the same Gmail reply automation problem shows up as slow responses and inconsistent tone.

This workflow drafts replies with OpenAI, asks you to approve them by email, and only then sends the response. You’ll see how it works, what you need, and where the real time savings come from.

How This Automation Works

The full n8n workflow, from trigger to final output:

n8n Workflow Template: Gmail + OpenAI: replies drafted, you approve, sent

The Problem: Inbox Replies Steal Your Best Hours

Replying to email sounds simple until you’re doing it 30 times a day with context switching in between. You open a message, search for past threads, hunt for policy details, then rewrite the same “friendly but firm” sentence again. And because you’re moving fast, tone slips. Details get missed. Sometimes you forget to reply entirely because you marked it “unread” and promised yourself you’d circle back. By the end of the week, that’s a pile of tiny decisions that drains attention you needed for real work.

It adds up fast. Here’s where it breaks down in day-to-day operations.

  • You waste about 5 minutes per email just re-reading threads and restating the same info.
  • When you’re rushing, replies get inconsistent, which means more back-and-forth and “just checking in” follow-ups.
  • Team inbox rules help with sorting, but they don’t write a solid response that matches your voice.
  • Even one missed message can become a customer support problem you didn’t need.

The Solution: Draft Replies in Gmail, Approve, Then Send

This n8n workflow watches your Gmail inbox for new messages, then uses an AI agent (like OpenAI) to decide if a reply is even needed. If it is, the workflow generates a context-aware draft using your business details, policies, FAQs, and style guidelines. Next, it emails you an approval request, with the drafted reply ready to review. You either approve or decline. When you approve, n8n sends the reply through Gmail automatically, so the sender gets a fast response without you copy-pasting anything. The end result is simple: you stay in control, but you’re no longer starting from a blank page.

The workflow starts with a Gmail trigger for new emails. AI assesses the message, drafts an HTML reply, then sanitizes the formatting so it looks clean in Gmail. Finally, a second “approval decision” step determines whether the reply is dispatched.

What You Get: Automation vs. Results

Example: What This Looks Like

Say you receive 25 customer or partner emails per day, and a “good” reply takes about 5 minutes once you include reading, checking details, and writing. That’s roughly 2 hours daily. With this workflow, you spend maybe 1 minute skimming the AI draft and approving, and the rest happens automatically. Even if only half your emails are eligible for AI drafting, that’s still about an hour back most days.

What You’ll Need

  • n8n instance (try n8n Cloud free)
  • Self-hosting option if you prefer (Hostinger works well)
  • Gmail to monitor inbox and send replies
  • OpenAI (or another LLM provider) to draft and assess replies
  • LLM API key (get it from your LLM provider dashboard)

Skill level: Beginner. You’ll connect Gmail, paste your business context, and test with a few real emails.

Don’t want to set this up yourself? Talk to an automation expert (free 15-minute consultation).

How It Works

A new email hits your inbox. The Gmail Trigger monitors for incoming messages so you don’t have to forward anything or remember to label it.

Your business context gets applied. A “Business Context” step injects your entity description, guidelines, and helpful resources (FAQs, policies, key info) so the AI isn’t guessing.

AI decides and drafts. The workflow assesses whether a response is needed, then drafts an HTML reply using your LLM chat model. If the email shouldn’t get a reply, it stops there.

You approve, then it sends. n8n emails you the draft for review, waits for your approval decision, and only then dispatches the reply via Gmail.

You can easily modify the “response needed” criteria to be stricter (or more permissive) based on your needs. See the full implementation guide below for customization options.

Step-by-Step Implementation Guide

Step 1: Configure the Gmail Trigger

Set up the workflow to start whenever a new email arrives in Gmail.

  1. Add and open Inbox Email Trigger.
  2. Credential Required: Connect your gmailOAuth2 credentials.
  3. Set Poll Times to everyMinute to check for new inbox emails.
  4. Leave Simple set to false to access full email fields (HTML, headers, sender data).

Tip: If you want to target a specific label or search query, add filters in Inbox Email Trigger before moving on.

Step 2: Connect Gmail

Ensure all Gmail actions can send and reply to messages.

  1. Open Dispatch Reply Email and confirm Credential Required: Connect your gmailOAuth2 credentials.
  2. Open Request Approval Email and confirm Credential Required: Connect your gmailOAuth2 credentials.
  3. Keep the Gmail account consistent across all Gmail nodes to avoid reply-thread mismatches.

⚠️ Common Pitfall: Using different Gmail accounts for Inbox Email Trigger and Dispatch Reply Email can cause reply failures or incorrect threading.

Step 3: Set Up Processing and AI Logic

Configure the business context and AI-driven decision logic that determines whether a reply is needed and drafts the HTML reply.

  1. Open Business Context and set the values for entity_name, entity_description, email_to_receive_approval, information_resource_guide, and response_guidelines. Example: entity_name = Sample Company.
  2. Open LLM Chat Model and select the model value gpt-4.1-mini.
  3. Credential Required: Connect your openAiApi credentials in LLM Chat Model.
  4. Open Assess Reply Requirement and keep the text prompt as defined. It uses expressions like {{ $('Inbox Email Trigger').item.json.headers.subject }} and {{ $('Inbox Email Trigger').item.json.html }} to judge reply necessity.
  5. Open Check If Response Needed and verify the boolean condition uses {{ $json.output.needs_reply }} with the operator set to true.
  6. Open Draft HTML Reply and keep the text prompt and jsonSchemaExample (HTML-only output) unchanged to ensure clean HTML replies.

Tip: LLM Chat Model is connected as the language model for Assess Reply Requirement and Draft HTML Reply—ensure credentials are added to LLM Chat Model, not the extractor nodes.

Step 4: Configure Output and Approval Flow

Finalize the reply, send it for approval, and dispatch once approved.

  1. Open Sanitize Email HTML and keep the jsCode that cleans HTML output to avoid invalid formatting.
  2. Open Request Approval Email and set sendTo to [YOUR_EMAIL].
  3. In Request Approval Email, set subject to =Review & Approve Reply: {{ $('Inbox Email Trigger').item.json.headers.subject }} and message to =Do you approve the reply? ... {{ $json.cleaned }}.
  4. Confirm Request Approval Email uses operation sendAndWait with approval type double.
  5. Open Approval Decision and confirm the condition checks {{ $json.data.approved }} to route approved replies.
  6. Open Dispatch Reply Email and set operation to reply with messageId {{ $('Inbox Email Trigger').item.json.id }}.
  7. In Dispatch Reply Email, set message to {{ $('Sanitize Email HTML').item.json.cleaned }} and include your signature HTML block.

⚠️ Common Pitfall: Forgetting to update [YOUR_EMAIL] and [YOUR_NAME] will cause approvals to go to the placeholder address and replies to have a generic signature.

Step 5: Test and Activate Your Workflow

Verify the full reply cycle before enabling automation.

  1. Click Execute Workflow and send a test email to the connected Gmail inbox.
  2. Confirm Assess Reply Requirement outputs needs_reply and routes into Check If Response Needed.
  3. Verify Draft HTML Reply produces a valid HTML block, then confirm Sanitize Email HTML outputs the cleaned HTML.
  4. Approve the email in Request Approval Email, and ensure Approval Decision routes to Dispatch Reply Email.
  5. When successful, you’ll see a reply sent in the Gmail thread matching the original messageId.
  6. Toggle the workflow to Active to enable continuous processing.
🔒

Unlock Full Step-by-Step Guide

Get the complete implementation guide + downloadable template

Common Gotchas

  • Gmail credentials can expire or need specific permissions. If things break, check the connected Gmail account in n8n’s Credentials section first.
  • If you’re using Wait nodes or external rendering, processing times vary. Bump up the wait duration if downstream nodes fail on empty responses.
  • Default prompts in AI nodes are generic. Add your brand voice early or you’ll be editing outputs forever.

Frequently Asked Questions

How long does it take to set up this Gmail reply automation automation?

About 30 minutes if your Gmail and LLM accounts are ready.

Do I need coding skills to automate Gmail reply automation?

No. You’ll mostly connect accounts and edit your “business context” text. The only technical part is testing a few emails to confirm the approval step behaves the way you want.

Is n8n free to use for this Gmail reply automation workflow?

Yes. n8n has a free self-hosted option and a free trial on n8n Cloud. Cloud plans start at $20/month for higher volume. You’ll also need to factor in OpenAI API costs (often a few cents per drafted reply, depending on length).

Where can I host n8n to run this automation?

Two options: n8n Cloud (managed, easiest setup) or self-hosting on a VPS. For self-hosting, Hostinger VPS is affordable and handles n8n well. Self-hosting gives you unlimited executions but requires basic server management.

Can I customize this Gmail reply automation workflow for different reply rules and tone?

Yes, and you should. Update the “Business Context” set step with your tone, formatting, and policies, then adjust the “Assess Reply Requirement” and “Check If Response Needed” logic so only the right emails get drafts. Common tweaks include excluding newsletters, only drafting replies for certain labels, and enforcing “ask for clarification” when details are missing. If you want approvals to go to a shared inbox or a manager, change the approval email address used in the approval request step.

Why is my Gmail connection failing in this workflow?

Usually it’s expired or revoked Gmail permissions. Reconnect the Gmail credential in n8n, then re-run a single test email to confirm the trigger and the “send” step can both access the same account. If it works sometimes and fails other times, you may be hitting rate limits or using the wrong mailbox (for example, sending from an alias that isn’t configured correctly).

How many emails can this Gmail reply automation automation handle?

A lot, as long as your n8n plan and email volume match.

Is this Gmail reply automation automation better than using Zapier or Make?

It depends on how picky you are about logic and control. Zapier and Make are fine for simple “email comes in, do one thing” setups, but they get awkward when you want branching decisions, richer prompting, and a clean approval loop. With n8n, you can self-host for unlimited executions and keep the workflow transparent, which is nice when you’re trusting AI with customer communication. Also, you can iterate quickly: change your business context, test, and you’re done. Talk to an automation expert if you’re torn, because the “best” choice is usually the one you’ll actually maintain.

You get faster replies without giving up control. Set it up once, and your inbox stops being the thing that derails your day.

Need Help Setting This Up?

Our automation experts can build and customize this workflow for your specific needs. Free 15-minute consultation—no commitment required.

Lisa Granqvist

Workflow Automation Expert

Expert in workflow automation and no-code tools.

×

Use template

Get instant access to this n8n workflow Json file

💬
Get a free quote today!
Get a free quote today!

Tell us what you need and we'll get back to you within one working day.

Get a free quote today!
Get a free quote today!

Tell us what you need and we'll get back to you within one working day.

Launch login modal Launch register modal