How to Build an AI Autoresponder with n8n and Gmail
A four-node n8n workflow that reads new Gmail inquiries, decides whether they're genuine, and replies with a short, personal answer. Free template to import.
Most inbound inquiries get their best chance of becoming a conversation in the first few minutes. An autoresponder that actually reads the message, and only answers real inquiries, takes about four nodes in n8n.
This guide walks through a simple version: a workflow that watches a Gmail inbox, asks an AI model whether each new email is a genuine inquiry, and sends a short, personal reply when it is. At the end there's a ready-made workflow you can import into your own n8n.
Download the workflow (JSON). It contains no credentials, so you'll connect your own accounts after importing.
What the workflow does
- Gmail Trigger checks your inbox every minute for new unread emails.
- Message a model sends the email text to an AI model with instructions: decide if it's a genuine inquiry, and if so, write a short reply.
- If checks the answer. If the model returned the word
DISQUALIFIED(spam, newsletters, receipts, automated mail), the workflow stops. - Send a message (Gmail) sends the reply to the original sender.
The qualification step is the important part. A plain autoresponder replies to everything. This one only replies when the email looks like a real person asking about your services.
What you need
- An n8n instance, either n8n Cloud or self-hosted.
- A Gmail or Google Workspace account to read from and send from.
- An API key from an AI provider. The template uses the Anthropic node, but the same pattern works with any chat model node in n8n.
Step 1: Import the workflow
Download the JSON file above. In n8n, create a new workflow, open the menu in the top right and choose Import from file. The four nodes appear on the canvas, with warnings on the ones that need credentials.
Step 2: Connect Gmail
Open the Gmail Trigger node and create a Gmail credential. n8n walks you through the Google sign-in (OAuth). Then select the same credential on the Send a message node.
The trigger is already filtered to unread emails in the inbox. Keep that filter. Without it, the trigger can also pick up mail you send yourself, including the autoresponder's own replies.
Step 3: Connect the AI model
Open the Message a model node, add your API key as a credential, and pick a model. Then edit the instructions so they describe your business. The template's prompt looks like this:
You are an assistant that helps respond to new customer inquiries for [YOUR COMPANY].
Your tasks:
1. Read the incoming email carefully.
2. Determine intent: is this a genuine inquiry about our services (YES)
or spam / unqualified / automated mail such as newsletters,
receipts and no-reply notifications (NO)?
3. If YES, write a polite, professional reply that:
- Thanks them for reaching out,
- Confirms you understand what they're asking for,
- Says we'd be happy to help,
- Invites them to book a call using this link: https://your-website.com/book-a-call
4. If NO, respond only with: "DISQUALIFIED".
5. Keep the reply under 120 words.
6. Match the language of the incoming email.
7. Use this template: "Hi {name}, thanks for reaching out. I just took a
look and we'd be happy to help with {short paraphrase of their request}.
What does your calendar look like tomorrow? Thanks, [YOUR NAME]"
Replace [YOUR COMPANY], [YOUR NAME] and the booking link. Three details make this prompt work well:
- A fixed escape word. Asking for exactly
DISQUALIFIEDgives the If node something unambiguous to check. - A word limit and a template. The reply stays short and sounds consistent, instead of drifting into a long, generic email.
- Language matching. The reply comes back in the language the sender used.
Step 4: Test before you turn it on
Send yourself an email from a different address, for example "Hi, I'm looking for a quote for a new website for my business." Then, in the Gmail Trigger node, fetch the test event and run the workflow step by step. Check three things:
- The model's output reads the way you'd write it.
- A deliberately irrelevant email (a newsletter, say) ends at the If node without sending anything.
- The reply arrives at the right address with a sensible subject.
Only activate the workflow once all three behave.
Guardrails worth adding
An AI that sends email on your behalf is only as safe as the checks around it. Treat the first week as supervised.
- Start with drafts. Swap the final node's operation from sending to Create a draft. You review and send manually until you trust the output.
- Keep the trigger narrow. Filter by inbox, by a label, or by the address a contact form sends to, so the workflow only sees mail it should answer.
- Keep replies in the thread. The template sends a new message with a "Re:" subject. If you want replies to land inside the original conversation, use the Gmail node's reply operation with the original message ID instead.
- Mind what you send to a model. The full text of each incoming email goes to your AI provider. Check that this fits your privacy policy and the kind of mail the inbox receives.
- Tell people. A line in the signature or the prompt template saying the first reply is automated avoids surprises.
Where to take it next
Once the basic flow works, the same four-node skeleton extends naturally: add a node that logs each qualified inquiry to a spreadsheet or CRM, route different types of inquiry to different reply templates, or add a notification to Slack when a lead arrives. These are all ordinary n8n nodes attached to the end of the existing flow.
If you'd rather have this built and tuned for your inbox and tools, see our AI automation services or book a call.
Next step
Want us to build this for you?
Tell us what you're trying to automate or grow. We'll tell you where AI and marketing can help, or you can book a free strategy call.
Send us a message