serverserv serverserv

AI reply drafts for Gmail: free n8n workflow template

By the serverserv team · 3 min read · Updated

This workflow reads each new email in your inbox, asks an AI model to write a reply in your tone, and saves it as a Gmail draft in the same thread. You open Gmail, check the draft, fix anything marked [CHECK] and press send.

Download the template

Free download
5 nodes · tested on n8n 2.35 · MIT licence · no credentials included
Download JSON
New emailGmail TriggerSkip automated sendersIfWrite replyAI AgentOpenAI Chat ModelOpenAI Chat ModelSave draft replyGmail
How the workflow is wired, from the trigger at the top. Dashed lines connect the AI model and memory to the agent.

How it works

  1. New email checks Gmail every minute for unread messages in your inbox.
  2. Skip automated senders ignores no-reply addresses, notifications and bounce messages.
  3. Write reply sends the sender, subject and the first 6,000 characters of the email to the AI model, with instructions to keep it short and never guess facts.
  4. Save draft reply creates a draft addressed to the sender, in the original thread.

Nodes used: Gmail Trigger, If, AI Agent, OpenAI Chat Model, Gmail.

What you need

  • A Gmail or Google Workspace account
  • An OpenAI API key, or another chat model connected to the AI Agent

Set it up

  1. Import the workflow. Connect Gmail in New email and Save draft reply (use the same credential).
  2. Open OpenAI Chat Model, add your API key and pick a model. A small, low-cost model is usually enough for email.
  3. Edit the system message in Write reply: add what your business does, your opening hours, your sign-off and anything it should never promise.
  4. Activate the workflow and send yourself a test email from another address.

New to importing? In n8n, open a new workflow, then either paste the copied JSON onto the canvas or use the menu (the three dots) and choose Import from file. Credentials are never included, so you connect your own accounts after importing.

Ways to customise it

  • Add a Gmail label filter so only one label (for example Support) gets drafts.
  • Give the agent a tool that reads your FAQ or a Google Doc so it can answer common questions properly.
  • Replace the OpenAI node with Anthropic, Gemini or a local Ollama model.

Security notes

Emails are untrusted input. The system message tells the model to answer only from the email and to mark gaps with [CHECK], and the workflow only ever creates drafts, never sends. Keep it that way: a model that can send email on its own can be tricked by a cleverly written message.

Where to run it

Templates with webhooks or triggers need n8n running all the time and reachable over HTTPS. You can run n8n on your own computer to try it, but for real use it belongs on a server. serverserv n8n Hosting gives you n8n pre-installed on your own KVM server with HTTPS, from $14.99 a month with no execution limits, and we will set up your first workflow for you, this one included.

Questions

Will it send emails without me?

No. It only creates drafts. You review and send each one yourself.

How much does the AI cost?

For a normal inbox, cents to a few dollars a month on a small model. Each email is one model call. Use our AI agent cost calculator to estimate yours.

Is this n8n template free to use?

Yes. It is free under the MIT licence, for personal and business use. You need your own n8n instance and your own accounts for the connected apps.

Sources

Plans from $3.99/moSee plans