▶ Stepthrough Content Start Learning Free
Home › Content › Business Automations

AI Email Responder: Draft Gmail Replies Automatically with n8n

Coming soonBusiness Automationsn8nGmailOpenAI~12 min58 stepsBeginner

Answering the same customer questions all day eats your time. In this free AI email responder tutorial you build an n8n agent that checks Gmail every minute, reads each new email and writes a reply as a draft in the same thread. It never sends anything, so you stay in control.

What you will build

You play the office at Greenline Pest Control, a family-run company. A customer, Dana, writes in: ants in the kitchen, does Greenline cover Maple Grove, and roughly what does a treatment cost? You build a workflow that answers emails like hers automatically.

A Gmail Trigger watches the inbox. An AI Agent reads the sender, subject and message. It knows Greenline's real service areas (Maple Grove, Cedar Falls and Brookside), prices ($149 for a first general pest visit, $89 for a follow-up) and booking hours, and it uses a Gmail tool to save a reply as a draft right under the customer's email. At the end, Dana's draft says yes to Maple Grove, gives the right price and asks for her address and two times that work.

Who this is for

This module is for service businesses that get the same questions every day: pest control, cleaning, landscaping, home repair, salons and more. If your inbox is full of "do you cover my area?" and "how much does it cost?", this is built for you. It reuses the OpenAI key from the n8n AI agent module.

It is also a good fit if you are nervous about letting AI talk to customers. Nothing leaves your inbox without you. The agent does the first draft, and you keep the final say on every reply.

Step by step: what you do

The lesson has 59 steps across ten chapters.

  • The email: look at the Gmail inbox and open Dana's message so you know what the agent will answer.
  • Gmail trigger: create a workflow, add a Gmail Trigger, sign in with Google and pick the business inbox, [email protected]. Leave it on Every Minute and Message Received, then click Fetch Test Event to see Dana's email as data: From, Subject, snippet and threadId.
  • AI Agent: add the agent, set Source for Prompt to Define below, and paste a prompt that pulls in From, Subject and the message with expressions in double curly brackets.
  • Chat model: add an OpenAI Chat Model and reuse your OpenAI account credential.
  • Draft tool: add a Gmail Tool on the same account, change the resource to Draft, let the model write the subject and message, and set the Thread ID option to the trigger's threadId so the draft lands in the same conversation.
  • Memory: add Simple Memory.
  • Instructions: add a System Message with four parts: who it is, what it knows, the rules (drafts only, never make up prices, dates or services) and how to write (friendly, short, plain text).
  • Test and fix: run the workflow, hit a real error ("No session ID found" in Simple Memory), and fix it by setting the session key to the email's threadId.
  • Check the draft and turn it on: read the draft in Gmail, then Publish so it runs every minute.

The error you fix, and why it matters

The first test fails on purpose. Simple Memory expects a chat session ID, and an email is not a chat, so there is nothing to tell conversations apart. Many people fix this by deleting the memory node. The lesson shows a better fix: define the session key yourself using the thread ID. Every email conversation has its own thread, so memory now keeps one conversation per customer. Seeing a real error and reading what it means is one of the most useful skills in n8n.

Why drafts, not sent emails

Setting the Gmail tool to Draft means the worst the agent can do is write something you never send. That makes it safe to switch on for a real business on day one. The system message adds a second guard: if the agent does not know something, it says someone from the team will follow up, instead of guessing a price or date. Plain text is used on purpose too, because it reads more like a person than a formatted template.

How to use this in your business

Swap Greenline's facts for yours: your towns, your prices, your hours and how customers book. Keep the rules section as it is. Each morning you open Gmail and find replies already written under each new question. Read, tweak if needed, and send. Most replies take seconds instead of minutes, and customers hear back faster.

Keep the "What you know" list honest and current. When a price changes or you add a town, update the system message and every future draft follows. If you notice the agent handing off the same question again and again, that is a sign to add the answer to its facts.

How the practice works

Each step is shown on the left under Watch, then you do it on the right under Your turn, in practice copies of n8n and Gmail. Every click is checked, and Do it for me finishes a step if you get stuck. No Gmail account is connected and no email is read or sent.

Frequently asked questions

Will the AI send emails without my approval?
No. The Gmail tool is set to create drafts only, and the system message says it cannot send email. You read each draft and send it yourself.
Is this course really free?
Yes. Stepthrough is completely free, and the practice copy needs no accounts. To build it for real you need your own n8n, OpenAI and Google accounts, and some of those cost money once you use them for real work.
How do I fix "No session ID found" in n8n Simple Memory?
Open the Simple Memory node, set Session ID to Define below, and use an expression that is unique per conversation. For email, the lesson uses the Gmail thread ID.
How does the draft end up in the same email thread?
The Gmail tool's Thread ID option is set to the threadId from the Gmail Trigger, so the draft is saved as a reply in that conversation.
How often does it check for new email?
The Gmail Trigger in the lesson polls every minute once the workflow is published.

More in Business Automations