# How to Automate Gmail Replies With AI Drafts (n8n)

> How to automate Gmail replies with AI drafts: an n8n agent saves every reply as a draft in the same thread and never sends it. Five nodes, step by step.

Source: https://learn.ynteractive.com/content/blog/ai-email-replies-gmail-drafts · Updated 2026-10-20 · Free from Stepthrough (https://learn.ynteractive.com)

Quick answer

**Short answer:** to automate Gmail replies with AI drafts, build an [n8n workflow](https://learn.ynteractive.com/content/glossary#workflow) with five nodes: a **Gmail Trigger**, an **AI Agent** with your business facts in its [system message](https://learn.ynteractive.com/content/glossary#system-prompt), an **OpenAI Chat Model**, a **Gmail Tool** set to **Draft**, and **Simple Memory**. Publish it, and every new email gets a reply waiting in the same thread. Nothing is sent until a person clicks Send. This is for small businesses that answer the same customer questions all day. The free [AI Email Responder](https://learn.ynteractive.com/content/ai-email-responder-gmail-drafts-n8n) lesson walks you through the whole build in a practice copy of n8n and Gmail.

Last updated October 20, 2026

[Take the free module →](https://learn.ynteractive.com/courses/n8n-jump-start/16)Module 16 of the free [n8n Jump Start](https://learn.ynteractive.com/courses/n8n-jump-start) course, about 12 minutes. No account needed.

By [Robert Breen](https://learn.ynteractive.com/content/about/robert-breen) · Published October 1, 2026 · Updated October 20, 2026 · 8 min read

n8n · Email · Gmail

## Watch: the idea in 0:57

### AI email replies as Gmail drafts

Explainer · 0:57 · with captions

An AI email responder for Gmail that saves every reply as a draft in the same thread, never sends it. Built in n8n with your real prices and rules.

**Transcript**

You can paste customer emails into ChatGPT for replies. An AI agent can write those drafts for you. The trick is to never let it send. In n8n, a Gmail trigger checks the inbox every minute. An AI agent reads each new email and writes a reply. Its only tool saves that reply as a draft. The Gmail tool starts on Send. Change Resource to Draft, and it can only create. Then add the Thread ID option, so the draft lands under the customer's email. Next, write the system message. Say who it is, what it knows, the rules and how to write. Without your real facts, the agent guesses prices. So one rule says: never make up prices, dates or services. In the lesson, the draft quotes the real price, $149. It waits in Gmail until a person clicks Send. Build it free in the AI Email Responder lesson.

Nobody wants a robot sending a made-up price to a customer at 11 p.m., so this setup only writes drafts. In the lesson you're the office at a made-up company, Greenline Pest Control.

## What are the ways to get AI draft replies in Gmail?

There are three, from no setup to fully automatic. Costs are as listed by the vendors as of October 2026.

| Route | What happens | Automatic? | Cost | Practice it free |
| --- | --- | --- | --- | --- |
| Help me write in Gmail | You open an email and ask [Gemini](https://learn.ynteractive.com/content/glossary#gemini) for a draft | No, one email at a time | Needs a Google plan with Gemini in Gmail | [Gmail filters, labels and AI draft replies](https://learn.ynteractive.com/content/gmail-filters-labels-ai-draft-replies) |
| ChatGPT copy and paste | You paste the thread and your facts, then paste the draft back | No | Works on any ChatGPT plan | [Reply Faster](https://learn.ynteractive.com/content/chatgpt-reply-to-customer-emails) |
| n8n agent (this guide) | Every new email gets a draft in the same thread | Yes | An n8n plan or self-hosting, plus OpenAI API usage | [AI Email Responder](https://learn.ynteractive.com/content/ai-email-responder-gmail-drafts-n8n) |

[AI email drafts: Gmail filters vs an n8n agent vs ChatGPT](https://learn.ynteractive.com/content/compare/ai-email-drafts-gmail-filters-vs-n8n-vs-chatgpt) compares the three in more detail.

## How do you automate Gmail replies with AI drafts, step by step?

Seven steps, each covered in its own section below:

1. **Add a Gmail Trigger** set to On message received, checking every minute.
2. **Add an AI Agent** and point its prompt at the email's From, Subject and message fields.
3. **Connect an OpenAI Chat Model** with your API key.
4. **Add a Gmail Tool set to Draft**, with the Thread ID and To Email options, so it can only create drafts in the right thread.
5. **Add Simple Memory**, keyed on the email's threadId.
6. **Write the system message:** who it is, what it knows, the rules and how to write.
7. **Test, then Publish** so it runs on its own.

## What does the n8n email responder do?

The n8n email responder checks Gmail every minute, writes a reply to each new email using your real facts, and saves that reply as a draft under the customer's message. A person reads the draft and clicks Send.

In the lesson, a customer named Dana writes in: ants in the kitchen, does Greenline cover Maple Grove, and roughly what does it cost? The workflow that answers her has five parts:

- **Gmail Trigger:** checks the inbox every minute for new messages.
- **AI Agent:** reads each email and decides what to write.
- **OpenAI Chat Model:** the model the AI Agent thinks with.
- **Gmail Tool**, set to **Draft:** saves the reply in the same thread.
- **Simple Memory:** lets the agent remember what it already told a customer who writes back.

## How do I make n8n watch my Gmail inbox?

Add a Gmail Trigger set to **On message received**, connect your Google account, and leave it on **Every Minute**.

1. Click **Create workflow**, then **Add first step**, search for Gmail and choose **On message received** under Triggers.
2. Open **Credential**, click **Create new credential**, then **Sign in with Google** and pick the inbox customers write to (office@greenlinepest.com in the lesson).
3. Leave **Every Minute** and **Message Received** as they are and click **Fetch Test Event**.

The Gmail Trigger's test event shows Dana's email as data: From, Subject, a snippet of the message and a threadId. Those fields feed every later step.

## How do I get the AI Agent to read an email instead of a chat?

Open the AI Agent's **Source for Prompt** and choose **Define below**, then paste a prompt that pulls in the email's fields. By default the n8n AI Agent expects a chat message, and an email is not a chat.

```text
Write a reply to this email, then save it as a draft in the same thread.
<email>
From: {{ $json.From }}
Subject: {{ $json.Subject }}
Message: {{ $json.snippet }}
</email>
```

The double curly brackets are n8n expressions that fill in fields from the email. Under **Chat Model**, add an **OpenAI Chat Model** and pick your OpenAI credential. The lesson reuses the key from the [AI Social Media Idea Agent](https://learn.ynteractive.com/content/n8n-ai-agent-tutorial-google-sheets) module and keeps the default model, since writing a short email is an easy job.

## How do I stop the AI from sending email on its own?

Set the Gmail Tool's **Resource** to **Draft**, so the operation becomes **Create** instead of Send. With Draft selected, the worst the agent can do is write a draft you never send.

1. Under **Tool**, add a **Gmail Tool** on the same Gmail account.
2. Open **Resource** (it starts on Message, with the operation Send) and choose **Draft**.
3. In **Subject**, paste `Re: {{ $json.Subject }}` so Gmail keeps the reply in the same conversation.
4. Next to **Message**, click the ✦ button so the model writes the body. Leave the email type on text.
5. Click **Add option**, choose **Thread ID** and paste `{{ $json.threadId }}`. Without the Thread ID option, the draft lands as a brand new email instead of a reply.
6. Click **Add option** again, choose **To Email** and paste `{{ $json.From }}` so the draft is addressed to the sender.

Then, under **Memory**, add **Simple Memory** and leave the defaults for now.

## What goes in the system message?

The system message has four parts: who the agent is, what it knows, the rules, and how to write. Without business facts, the agent guesses prices. Open the AI Agent, click **Add Option** and choose **System Message**.

- **Who you are:** it writes email replies for Greenline Pest Control, a family-run pest control company.
- **What you know:** Greenline services Maple Grove, Cedar Falls and Brookside; general pest treatment is $149 for the first visit and $89 for a follow-up; booking is Monday to Saturday, 8am to 5pm; to book, the customer replies with an address and two times that work.
- **Rules:** "You cannot send email. You can only create drafts." If it doesn't know something, it says someone from the team will follow up, and it never makes up prices, dates or services.
- **How to write:** friendly, plain and short, plain text, signed "The Greenline team".

To use it for your business, swap in your own towns, prices and hours and keep the rules section as it is.

## Try it free, step by step

**n8n AI Email Responder: Draft Gmail Replies Automatically**. Build an n8n agent that watches your Gmail, reads each new customer email, and writes a reply as a draft in the same thread, ready for you to check and send. You do every step yourself in a practice copy of n8n, it checks your work as you go, and “Do it for me” finishes any step you get stuck on. Free, and nothing touches your real accounts.

[Start the free lesson](https://learn.ynteractive.com/modules/email-responder)

[Or read the full step-by-step guide](https://learn.ynteractive.com/content/ai-email-responder-gmail-drafts-n8n)

## Why does the first test fail with "No session ID found"?

The first test fails because Simple Memory looks for a chat session ID, and an email has none. Click **Execute workflow** and the Simple Memory node turns red with **No session ID found**. The fix is to open Simple Memory, set **Session ID** to **Define below** and use `{{ $json.threadId }}` as the key, so memory keeps one conversation per email thread. That beats deleting the memory node, the quick fix you'll often see. More in [Fix "No session ID found" in n8n Simple Memory](https://learn.ynteractive.com/content/blog/n8n-no-session-id-found).

Run **Execute workflow** again and everything goes green. In Gmail, the draft sits under Dana's email: yes to Maple Grove, $149 for the first visit, and a request for her address and two times. The draft has not been sent.

## How do I make it run on its own?

Click **Publish**, keep the default version name, and click **Publish** again. A published n8n workflow checks the inbox every minute without anyone pressing Execute workflow, and every new email gets a draft waiting for you.

Keep the "What you know" list current, and read each draft before you send it. For what to look for, see [Check AI Email Drafts for Promises Before You Send](https://learn.ynteractive.com/content/blog/check-ai-drafts-for-promises).

## What does it cost to run?

The lesson is free and connects no real accounts, but the real build uses paid services. The OpenAI API is pay-as-you-go and billed separately from any ChatGPT plan, and you add credit at platform.openai.com before the key works. n8n Cloud is a paid service after its free trial (as of October 2026, Starter is listed at €20 a month billed annually for 2,500 executions), and n8n can also be self-hosted. Gmail works with a regular Google account.

## Is there a simpler option without automation?

Yes: copy the thread into ChatGPT, get a draft, and paste the reply into Gmail yourself. The [Reply Faster](https://learn.ynteractive.com/content/chatgpt-reply-to-customer-emails) lesson teaches that routine, including a numbered facts list and a check of every promise in the draft. It works with any ChatGPT plan and nothing runs in the background.

Both lessons are part of the [Email on Autopilot](https://learn.ynteractive.com/content/paths/email-on-autopilot) path, and there are more builds in the [n8n tutorials](https://learn.ynteractive.com/content/tool/n8n).

## Key takeaways

- An n8n agent can write email replies as Gmail drafts, so no AI-written email goes out until a person clicks Send.
- Setting the Gmail Tool's Resource to Draft, with the Thread ID option set to the trigger's threadId, puts each reply in the customer's thread.
- A four-part system message (who it is, what it knows, rules, how to write) keeps the agent from inventing prices, dates or services.
- The "No session ID found" error in Simple Memory is fixed by using the Gmail threadId as the session key.
- The OpenAI API is billed separately from ChatGPT, and n8n Cloud is paid after its free trial unless you self-host n8n.

## Frequently asked questions

**How do I automate Gmail replies with AI drafts?**

Build an n8n workflow: a Gmail Trigger, an AI Agent with your facts in the system message, an OpenAI Chat Model, a Gmail Tool set to Draft with the Thread ID option, and Simple Memory. Publish it and each new email gets a draft reply in its thread for you to read and send.

**Will the AI send emails without my approval?**

No. The Gmail Tool is set to Draft, so the agent can only create drafts, and the system message also says it cannot send email.

**How does the draft end up in the same Gmail thread?**

The Gmail Tool's Thread ID option is set to the threadId from the Gmail Trigger, and the subject is "Re:" plus the original subject.

**How often does it check for new email?**

Every minute. The Gmail Trigger is left on Every Minute, and the workflow runs on its own once it is published.

**What if a customer asks something the agent doesn't know?**

The system message tells the agent to say someone from the team will follow up and never to make up prices, dates or services.

## Free lessons in this post

- [n8n AI Email Responder: Draft Gmail Replies Automatically](https://learn.ynteractive.com/content/ai-email-responder-gmail-drafts-n8n): Build an n8n agent that watches your Gmail, reads each new customer email, and writes a reply as a draft in the same thread, ready for you to check and send.
- [Reply Faster: Turn a Messy Customer Email Thread into a Clear, Friendly Reply](https://learn.ynteractive.com/content/chatgpt-reply-to-customer-emails): Turn a messy customer email thread into a clear, friendly reply: give ChatGPT the thread and your facts, check every promise, fix the tone, and send it from Gmail.

## Watch it in a free lesson: Gmail AI Triage: Auto-Label Every Email and Draft Replies

### Gmail AI Triage: Auto-Label Every Email and Draft Replies: video walkthrough

Full walkthrough · 2:31 · with captions

Build an n8n workflow that reads each new email, sorts it as a lead, a client or an invoice with a Text Classifier, adds the matching Gmail label, and drafts a reply to clients for you to check. The whole lesson narrated step by step, recorded in Stepthrough’s simulated practice environment.

[Watch it with chapters and the full transcript](https://learn.ynteractive.com/content/gmail-ai-triage-labels-drafts-n8n#watch)

From the free lesson [Gmail AI Triage: Auto-Label Every Email and Draft Replies](https://learn.ynteractive.com/content/gmail-ai-triage-labels-drafts-n8n)

## Related terms

Plain-English definitions, each with an example from a free lesson.

[Workflow](https://learn.ynteractive.com/content/glossary#workflow) · [System prompt (system message)](https://learn.ynteractive.com/content/glossary#system-prompt) · [Gemini](https://learn.ynteractive.com/content/glossary#gemini) · [Action](https://learn.ynteractive.com/content/glossary#action) · [Agent memory](https://learn.ynteractive.com/content/glossary#agent-memory) · [AI Agent node](https://learn.ynteractive.com/content/glossary#ai-agent-node) · [Artificial intelligence (AI)](https://learn.ynteractive.com/content/glossary#artificial-intelligence) · [Deferred revenue](https://learn.ynteractive.com/content/glossary#deferred-revenue)

[The full AI glossary](https://learn.ynteractive.com/content/glossary)

## Related prompts

- [Check reply promises prompt](https://learn.ynteractive.com/content/prompts/check-reply-promises-prompt): A ChatGPT prompt that checks a draft before you send it: a table of every promise, the fact behind each, and safer wording for…

[All free prompt templates](https://learn.ynteractive.com/content/prompts)

## More terms on this topic

[Invoice](https://learn.ynteractive.com/content/glossary#invoice)

## Visual guides

The same ideas as quick visual guides: swipe through the slides, or read each one as text.


[All visual guides](https://learn.ynteractive.com/content/visual)

## Keep reading

- [How to Catch Up on Email After Vacation, with AI's Help](https://learn.ynteractive.com/content/blog/catch-up-on-email-after-vacation): Catch up on email after vacation: triage the backlog, answer the oldest customer first with one apology, and let ChatGPT or an n8n agent draft replies.
- [Human in the Loop AI: Keep a Person in Charge](https://learn.ynteractive.com/content/blog/human-in-the-loop-ai): Human in the loop AI for small businesses: drafts instead of sends, review sheets, Needs Review buckets and a final read, with a checklist to design it.
- [ChatGPT vs n8n: Which One Do You Need for Work?](https://learn.ynteractive.com/content/blog/chatgpt-vs-n8n): ChatGPT is where you work with AI yourself; n8n runs tasks on its own when something happens. How they differ, what each costs, and when to use both.

[All blog posts](https://learn.ynteractive.com/content/blog) · [All free tutorials](https://learn.ynteractive.com/content)
