🔓 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: polished reply drafts, ready to send

Lisa Granqvist Partner Workflow Automation Expert

Your inbox doesn’t just get “busy.” It turns into a decision factory. Every new message forces you to reread context, choose a tone, and type the same explanations again and again.

Support leads feel it first. A solo founder answering sales questions feels it too. And honestly, agency operators drown in it when client threads stack up. This Gmail OpenAI drafts automation gives you ready-to-edit reply drafts inside the right thread, so you can reply faster without losing control.

You’ll see how it decides when a reply is needed, generates a polished draft using OpenAI, and saves it in Gmail as a draft reply (nothing is sent automatically).

How This Automation Works

The full n8n workflow, from trigger to final output:

n8n Workflow Template: Gmail + OpenAI: polished reply drafts, ready to send

The Problem: Reply fatigue turns email into a bottleneck

Replying to email isn’t “just typing.” It’s reading a thread, finding the actual question, deciding if it even deserves a response, and then writing something that sounds like you on a day when you’re tired. Multiply that by a few dozen emails and you end up pushing real work to tomorrow. Worse, quick replies become sloppy replies. You miss details, your tone drifts, and you spend extra time fixing misunderstandings later because the first response wasn’t clear.

It adds up fast. Here’s where it typically breaks down.

  • You reread the same thread twice because you get interrupted mid-reply.
  • High-volume inbox days can steal about 2 hours that should have gone to actual delivery work.
  • Some messages don’t need a response, but you still spend time deciding that.
  • Tone inconsistency creeps in, which causes follow-up questions and longer threads.

The Solution: Draft Gmail replies with OpenAI, then you approve

This workflow watches your Gmail inbox for new messages and quietly steps in before you start typing. When an email arrives, it uses an OpenAI-based “should we reply?” check to judge if a response is necessary. If the email looks like a real request, it generates a well-structured reply draft using your prompt (so it matches your voice and policies). Then it converts the response into HTML and creates a Gmail draft inside the same thread, set up as a reply to the first message. You open Gmail, see a polished draft ready to send, and edit anything you want.

The workflow starts with a Gmail trigger. OpenAI evaluates the email and flips a simple yes/no flag. If it’s a “yes,” OpenAI writes the reply and n8n saves it as a draft reply in Gmail so nothing gets sent without you.

What You Get: Automation vs. Results

Example: What This Looks Like

Say you handle 40 emails a day that might need responses. If you spend about 4 minutes reading, thinking, and drafting each one, that’s roughly 2.5 hours of reply work. With this workflow, the “drafting” part is mostly done for you. You still skim and edit, but that often drops to about 1 minute per email, plus a few minutes to tweak your prompt occasionally. That’s around 1 hour back on a normal day, sometimes more when the inbox gets wild.

What You’ll Need

  • n8n instance (try n8n Cloud free)
  • Self-hosting option if you prefer (Hostinger works well)
  • Gmail for inbox monitoring and draft creation
  • OpenAI to evaluate and generate replies
  • Google OAuth credentials (create in Google Cloud Console with Gmail API modify scope)

Skill level: Intermediate. You’ll connect OAuth, paste an API key, and tweak one main prompt.

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

How It Works

New email hits your inbox. The Gmail trigger fires as soon as a message arrives, pulling in the subject, sender, and thread content you need for context.

AI decides if a reply is needed. An OpenAI step reads the email and outputs a simple structured flag (yes/no) using a JSON parser so the workflow can reliably route the message.

Draft text is composed. If the flag is “yes,” OpenAI generates a reply based on your system prompt. This is where you bake in tone, policies, and “don’t promise X” constraints. It’s the difference between a helpful draft and a risky one.

A Gmail draft appears in the thread. n8n converts the reply into HTML and creates a Gmail draft as a reply to the first message in the thread, so you can open Gmail and send it when you’re ready.

You can easily modify the prompt and the “reply required” logic to match your inbox rules 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 incoming email trigger so the workflow starts whenever a new Gmail message arrives.

  1. Add the Gmail Intake Trigger node to your workflow.
  2. Set Simple to false.
  3. Set the Gmail search filter q to -from:me to ignore your own sent emails.
  4. Set the polling interval to everyMinute under Poll Times.
  5. Credential Required: Connect your gmailOAuth2 credentials.

If the trigger doesn’t fire, confirm the Gmail account has new incoming emails and the query -from:me isn’t excluding them.

Step 2: Connect Gmail for Draft Creation

Prepare the output destination so drafts are created in the same email thread.

  1. Add the Create Gmail Draft node.
  2. Set Resource to draft and Email Type to html.
  3. Set Message to {{ $json.text.replace(/\n/g, "<br />\n") }}.
  4. Set Subject to Re: {{ $('Gmail Intake Trigger').item.json.headers.subject }}.
  5. In Options, set Send To to {{ $('Gmail Intake Trigger').item.json.headers.from }} and Thread ID to {{ $('Gmail Intake Trigger').item.json.threadId }}.
  6. Credential Required: Connect your gmailOAuth2 credentials.

Step 3: Set Up Reply Evaluation with AI

Use AI to determine whether an email requires a response and parse the result into a structured boolean.

  1. Add the Evaluate Reply Need node and set the Prompt to Subject: {{ $json.subject }} Message: {{ $json.textAsHtml }}.
  2. In Evaluate Reply Need, add the instruction message: “Your task is to assess if the message requires a response. Return in JSON format true if it does, false otherwise. Marketing emails don't require a response.”
  3. Connect OpenAI Chat Engine as the language model for Evaluate Reply Need and set Model to gpt-4o.
  4. Credential Required: Connect your openAiApi credentials in OpenAI Chat Engine.
  5. Add Parse Reply Flag as the output parser for Evaluate Reply Need and set the JSON schema to the provided boolean structure.

Credential Required: Parse Reply Flag is an AI sub-node. Add credentials to its parent node OpenAI Chat Engine, not to Parse Reply Flag.

Step 4: Route Emails Based on Reply Need

Use a condition to send only emails that require replies to the draft generator.

  1. Add the Reply Required Check node after Evaluate Reply Need.
  2. Set the boolean condition Left Value to {{ $json.needsReply }} and compare it to true.
  3. Connect the true output of Reply Required Check to Compose Draft Text.

If drafts aren’t created, verify the AI output includes needsReply as a boolean and that the condition is using strict type validation.

Step 5: Generate Draft Text with AI

Use a second AI model to create the draft response using the incoming email content.

  1. Add the Compose Draft Text node and set Prompt Type to define.
  2. Set Text to Subject: {{ $('Gmail Intake Trigger').item.json.subject }} Message: {{ $('Gmail Intake Trigger').item.json.textAsHtml }}.
  3. Keep the provided drafting instructions in the message block to control tone, formatting, and language.
  4. Connect Draft Model Selector as the language model for Compose Draft Text and set Model to gpt-4-turbo.
  5. Credential Required: Connect your openAiApi credentials in Draft Model Selector.

Step 6: Configure Output to Gmail Drafts

Send the AI-generated draft text to Gmail as a new draft in the original thread.

  1. Connect Compose Draft Text to Create Gmail Draft.
  2. Confirm that Message, Subject, Send To, and Thread ID use the expressions shown in Step 2.
  3. Ensure Email Type remains html so line breaks render correctly.

Step 7: Test and Activate Your Workflow

Run a manual test to verify the AI decision, conditional routing, and Gmail draft creation.

  1. Click Execute Workflow and send a test email to the connected Gmail account.
  2. Verify that Evaluate Reply Need outputs {"needsReply": true} for emails that should be answered.
  3. Confirm a draft is created by Create Gmail Draft and appears in Gmail drafts with the expected subject and recipient.
  4. Toggle the workflow to Active to enable continuous monitoring.
🔒

Unlock Full Step-by-Step Guide

Get the complete implementation guide + downloadable template

Common Gotchas

  • Gmail OAuth credentials can expire or lack the right scope. If drafts stop appearing, check your Google Cloud Console OAuth consent and ensure Gmail API “modify” scope is granted in n8n.
  • 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 OpenAI drafts automation?

About 10 minutes if your Google OAuth is ready.

Do I need coding skills to automate Gmail reply drafts?

No. You’ll connect Gmail and OpenAI, then edit the prompt. n8n handles the logic and draft creation.

Is n8n free to use for this Gmail OpenAI drafts 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, which are usually a few cents per batch of emails 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 OpenAI drafts workflow for my brand voice and policies?

Yes, and you should. Update the system prompt in the “Compose Draft Text” / “Generate email reply” part of the workflow so it uses your greeting style, sign-off, and any rules like “never offer refunds” or “always ask for an order number.” You can also tighten the “Evaluate Reply Need” logic so newsletters, receipts, and FYI threads don’t generate drafts. Common customizations include inserting snippets for FAQs, adding different tones for VIP customers, and forcing the model to ask one clarifying question when details are missing.

Why is my Gmail connection failing in this workflow?

Most of the time it’s OAuth scope or consent settings. Double-check that Gmail API is enabled in Google Cloud Console, and that you authorized with a scope that allows draft creation (modify). If you changed the OAuth consent screen or rotated credentials, reconnect the Gmail credential in n8n so the refresh token updates. Rate limiting is less common here, but it can happen if you’re processing a big backlog.

How many emails can this Gmail OpenAI drafts automation handle?

A lot, as long as your n8n plan and server can keep up. On n8n Cloud Starter, you’re capped by monthly executions; on self-hosted n8n there’s no execution limit, it mainly depends on your VPS size and Gmail/OpenAI limits. Practically, most small teams run this all day without thinking about it.

Is this Gmail OpenAI drafts automation better than using Zapier or Make?

Often, yes. This workflow uses multi-step logic (AI evaluation, structured parsing, conditional branching, then draft creation), and n8n handles that kind of flow cleanly without turning it into an expensive chain of premium steps. You also get the self-hosting option, which matters when volume grows. Zapier or Make can still be fine if you want the simplest possible setup and you don’t care about deeper control. If you’re unsure, Talk to an automation expert and describe your inbox volume and risk tolerance.

You still approve every message, but the hard part is done. Set it up once, then let drafts pile up while you focus on work that actually moves the needle.

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