Templates / Automatically reply to customer emails with Airtable, Gmail, and GPT-4.1 Mini

Automatically reply to customer emails with Airtable, Gmail, and GPT-4.1 Mini

Ready for 3.0

by Baptiste Fort ✓ · 932 views · created 2025-09-17 · AI Chatbot

Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-10-19.

Worth a look

Nodes used (6)

AI AgentGmailOpenAI Chat ModelAirtableSimple Memory

What it does

Automatically Reply to Customer Emails with Airtable, Gmail, and OpenAI !repondreautomatiquementemailsn8nairtablegmailopenai.png(fileId:2643) Introduction This guide walks you step by step through setting up an automated agent that: - Receives emails sent by your customers. - Analyzes the content of the email. - Generates an appropriate response using an AI model (OpenAI GPT). - Stores all information (received email, AI response, date, customer email) in Airtable. - Automatically replies to the customer in the same Gmail thread. --- Prerequisites Before you start, you’ll need: - A Gmail account connected to n8n. - An Airtable account. - An n8n instance (cloud or self-hosted). - An OpenAI API key. --- Prepare the Airtable Base !Baseairtable.png(fileId:2645) No need to build everything from scratch — here’s a ready-to-use base you can copy: 👉 Open the Airtable base It already contains the following structure: - Subject (text) → email subject. - Date (date/time) → date of reception. - Customer Email (text) → customer’s email address. - Message (long text) → body of the received email. - AI Response (long text) → AI-generated reply. You can reuse it as it is or duplicate it into your Airtable account. 1. Set Up Gmail Trigger in n8n !automatisationsupportclientn8nairtablegmail.png(fileId:2644) Alright, now that we have our Airtable base ready, we need to capture customer emails. That’s the job of the Gmail Trigger. Basically, this node lies in wait inside your inbox, and as soon as a new message arrives… bam, your workflow fires up. Connect Your Gmail Account - In n8n, add a Gmail Trigger node. - Click Credential to connect with and select your Gmail account. - If you haven’t done it yet, click Add new, connect your Google account, and allow access. Pro tip: don’t worry, it won’t read your personal emails to gossip — everything stays inside your workflow. Basic Settings - Poll Times: select Every Minute. → This way, n8n checks your inbox every minute. - Mode: Message Received. → You want the flow to trigger whenever a customer writes to you. - Event: Message Received. → Same logic, keep it simple. - Simplify: turn it off (OFF). → Why? Because if you enable "Simplify," you only get a stripped-down version of the email. And you want it all: subject, sender, raw message… the full package. Expected Output When you execute the node, you should see: - id: unique identifier of the email. - threadId: conversation identifier (super useful to reply in the same thread). - snippet: a short preview of the email (first lines). - From: your customer’s email address. - To: your email address. - Subject: the subject of the email. - payload: the full body of the email (yep, in base64 — but we’ll handle that later). And that’s it — your Gmail Trigger is set up. In short, the moment a customer writes “Hey, I have an issue with my account,” your workflow kicks in instantly (well, almost — it checks every minute). 2. Set Up the AI Agent in n8n !sauvegarderemailsreponsesairtablen8n.png(fileId:2646) After configuring your Gmail Trigger (which captures incoming customer emails), you now need a brain to take over, analyze the email, and draft a reply. That’s where the AI Agent node comes in. Its Role The AI Agent node is used to: - Read the email content (via the Gmail Trigger). - Understand the context and tone of the customer. - Generate a clear, concise, and human-like response. - Prepare a personalized reply that will later be sent back via Gmail and stored in Airtable. In short, it’s your 24/7 support colleague, but coded as a bot. --- How to Configure It - Source for Prompt (User Message) → choose Define below. - Prompt (User Message) → describe your business and role as if you were training an intern. Example: “You are an AI support agent for a company that sells solar panels. You respond to technical requests, quotes, and customer questions. Your replies must be short, clear, friendly, and precise.” - Chat Model → connect your AI model (e.g. OpenA

View the original on n8n.io → Check your own copy

Get the weekly “what broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.