Draft Gmail replies with AI in n8n (free template, no auto-send)

By the TestedFlows team · Published October 16, 2026 · Updated October 20, 2026

This page contains affiliate links. If you sign up through them we may earn a commission, at no extra cost to you. How we make money.

Answering routine email is slow, but letting AI send replies on your behalf is risky. This workflow takes the safe middle path: for every new email, n8n writes a reply with AI and saves it as a draft inside the same Gmail thread. You open Gmail, read the draft, fix anything, and press send. Nothing leaves your inbox without you.

What you’ll build: new email in Gmail → skip automated senders → AI writes a reply → your real Gmail signature is added → reply saved as a Gmail draft in the thread. Time: about 15 minutes. You need: n8n (Cloud or self-hosted), a Gmail or Google Workspace account and an OpenAI API key.

Download the free workflow template

How the workflow works

The n8n Gmail AI reply workflow: New email in Gmail, Skip no-reply senders, Write reply with AI using an OpenAI model, Get Gmail signature, then Save as Gmail draft

  1. New email in Gmail checks your inbox every minute for unread emails, skipping the Promotions, Social and Updates tabs.
  2. Skip no-reply senders drops emails from addresses containing “noreply” or “no-reply”, such as receipts and notifications.
  3. Write reply with AI sends the sender, subject and body to an AI model with instructions on tone, length and what not to invent.
  4. Get Gmail signature reads your current default signature from Gmail’s settings.
  5. Save as Gmail draft creates the reply with your signature as a draft in the original thread, addressed to the sender.

Step 1: Import the template

Download the template above. In n8n, create a new workflow, open the ⋯ menu at the top right, choose Import from File and select the file. The Gmail and OpenAI nodes will show warnings until you connect your accounts.

Step 2: Connect Gmail and choose which emails to answer

Open New email in Gmail and connect your Google account. On n8n Cloud, sign in with Google directly; on a self-hosted instance, you first create an OAuth client in Google Cloud, which n8n’s Google credentials guide walks through.

The Search filter uses Gmail’s own search syntax. The template uses:

in:inbox -category:promotions -category:social -category:updates

Narrow it to the emails you actually want help with. For example, only emails to your sales address:

in:inbox to:sales@yourcompany.com

Or only emails with a label you apply with a Gmail filter:

label:ai-draft

The trigger looks at unread emails and checks every minute. On n8n Cloud, each check that finds new emails uses one execution, so a less frequent schedule (every 5 or 15 minutes) saves executions if instant drafts are not needed.

Step 3: Write the AI instructions

The Write reply with AI node holds two prompts. The user prompt passes in the email; the system message tells the AI how to behave:

Settings of the Write reply with AI node: the user prompt with the sender, subject and email body, and a system message with the drafting rules

The template’s system message is:

You draft email replies for a busy professional. Write in plain, friendly English, under 150 words. Answer the sender’s actual question. If something needs a decision or information you do not have, write [CHECK: what is needed] instead of guessing. Do not invent prices, dates or commitments. Return only the reply body, with no subject line and no signature.

The [CHECK: …] rule is the most important line. It makes the AI flag what it does not know instead of making it up, and you can search drafts for “CHECK” before sending.

Make it yours by adding facts the AI should know: your opening hours, your standard prices or links you often share. Every detail you add here means less editing later. Do not add a sign-off or signature to the prompt; the next step adds your real one.

Then click the OpenAI model node and add your OpenAI API key. The template uses gpt-5-mini; for longer or more sensitive replies, a larger model writes better drafts at a higher cost per email.

Step 4: Add your real Gmail signature

Drafts created through the Gmail API do not get your Gmail signature automatically, the way a reply you start by hand does. So the template reads it from Gmail itself. The Get Gmail signature node makes one request to Gmail’s settings, GET https://gmail.googleapis.com/gmail/v1/users/me/settings/sendAs, using the same Gmail credential as the other nodes:

Settings of the Get Gmail signature node: an HTTP GET request to the Gmail API sendAs settings using the predefined Gmail OAuth2 credential

Gmail returns every address you can send from, each with its signature. The draft step picks the one marked as your default, converts its HTML to plain text, and adds it two lines below the AI’s reply. Because it is read at the moment each draft is created, a signature you change in Gmail’s settings shows up in the next draft with nothing to edit in n8n.

Open the node and select your Gmail credential; nothing else needs changing. If you have no signature set in Gmail, the draft simply ends with the AI’s reply.

Step 5: Check the draft settings

Settings of the Save as Gmail draft node: resource Draft, operation Create, subject starting with Re:, message combining the AI reply with the Gmail signature, and options for thread ID and To email

The Save as Gmail draft node creates the draft with:

  • Subject: Re: plus the original subject
  • Message: the AI’s reply, followed by your default Gmail signature
  • Thread ID: the original email’s thread, so the draft appears inside the conversation, not as a separate email
  • To email: the original sender

Connect the same Gmail account here. There is nothing else to change.

Step 6: Test and publish

  1. From another email account, send yourself two test emails: a simple question (“What are your opening hours?”) and one the AI cannot answer alone (“Can you do the project for $3,000 by Friday?”).
  2. In n8n, open the trigger and click Fetch Test Event, then run the workflow.
  3. Open each thread in Gmail. You should see a draft reply ending with your Gmail signature. The second one should contain a [CHECK: …] note instead of an invented price or date.
  4. When the drafts look right, click Publish. From now on, new emails get drafts automatically.

Common problems and fixes

No drafts appear. The email may not match your search filter, may already be read, or may be in a skipped category. Test the search text in Gmail’s own search box first.

Drafts appear as new emails, not in the thread. The Thread ID option is missing or empty. Check that it reads {{ $('New email in Gmail').item.json.threadId }}.

The signature is missing. Check that a default signature is set in Gmail under Settings, General, Signature. If Get Gmail signature fails with a 403 error, reconnect the Gmail credential so it is granted access to your Gmail settings.

The signature looks wrong in the draft. The template turns your HTML signature into plain text, so images and colours are dropped. For a formatted signature, set the draft node’s Email Type to HTML and use the signature HTML directly.

Replies to newsletters and receipts. Add more exclusions to the filter node or the search, such as -from:billing@ or -label:receipts.

The AI invents details. Strengthen the system message and add the facts it keeps getting wrong. Keep the [CHECK] rule.

Google says “access blocked” on a self-hosted instance. Your OAuth app is in testing mode. Add your Google account as a test user in Google Cloud, or publish the app.

Ideas to extend it

  • Classify first: add n8n’s Text Classifier before the AI step to route emails (sales, support, billing) to different prompts.
  • Use your knowledge: connect a vector store or a Google Doc of FAQs so the AI can answer from your own information.
  • Notify: post a Slack message when a draft is ready for an important sender.
  • Label: add a Gmail node that labels the original email “AI draft ready”, so you can filter for them.

Find more ready-made workflows in the template library, including AI lead qualification.

Try n8n Cloud free

Frequently asked questions

Will this send emails without my approval?

No. It only creates drafts. Nothing is sent unless you open the draft and press send yourself.

Does it work with Google Workspace?

Yes. Google Workspace accounts use the same Gmail nodes. Your Workspace admin may need to allow the n8n app.

Is my email content sent to OpenAI?

Yes, the email you are replying to is sent to the AI provider you choose. For sensitive mail, narrow the search filter, or use a model you host yourself, such as Ollama.

Can I use Outlook instead of Gmail?

Yes. Replace both Gmail nodes with the Microsoft Outlook trigger and node, which also support creating drafts.

Related