Automate Gmail with n8n: labels, digests and auto-replies
This page may contain affiliate links.
Let’s be honest: Gmail is a black hole. You start the day with 47 unread emails, and by 10am you’ve got 63. Some are invoices, some are newsletters you meant to unsubscribe from, and a few are actually important — but you can’t tell which is which without opening every single one. That’s where n8n comes in. n8n is a self-hosted, node-based automation tool that plugs straight into Gmail’s API. You can build workflows that label, summarise, and even reply to emails automatically — no coding required (well, a tiny bit of JavaScript if you want the fancy stuff, but I’ll hold your hand through it). And the best part? You run it on your own server, so your data stays yours. No third-party cloud reading your mail. This guide will walk you through three practical automations: smart labelling, a daily digest, and contextual auto-replies. By the end, you’ll have an inbox that works for you, not the other way round.
Why n8n beats Gmail’s built-in filters
Gmail’s native filters are fine for basic stuff — “if from X, apply label Y”. But they’re dumb. They can’t read the content of an email, decide if it’s urgent based on tone, or send you a summary at 8am. n8n can. Because it connects to Gmail via the API, you can trigger workflows on new emails, then use any of n8n’s 400+ nodes to process them. For example, you can pull the email body, run it through OpenAI’s GPT to categorise it, then apply a label and forward a summary to your phone. All of that in a visual drag-and-drop editor. And because n8n is free to self-host (the community edition), the only cost is your server — which you might already have for other projects. A Raspberry Pi 5 will handle it fine for personal use, or a £5-a-month VPS if you want it always on. Compared to paying £10-£20 a month for a SaaS email tool, that’s a bargain.
Automation 1: Smart labelling with AI
First up, the classic: auto-label incoming mail. But instead of dumb rules, we’ll use AI to understand each email. Here’s the workflow: Gmail Trigger (new email) → OpenAI (classify) → Gmail (apply label). In n8n, you start with a Gmail Trigger node set to ‘message received’. Then add an HTTP Request node that calls OpenAI’s chat completions API. Your prompt could be: “You are an email assistant. Classify this email into one of these labels: INVOICE, CLIENT, NEWSLETTER, URGENT, PERSONAL. Reply with just the label.” Then pass the email body into the prompt. The response comes back as text, and you use a Switch node to map it to the right Gmail label. For the Gmail node, use the ‘Add Label’ operation and select the message ID from the trigger. One tip: don’t label everything as URGENT — you’ll get numb to it. Instead, have the AI only flag URGENT if it mentions deadlines, payment due, or words like “asap”. Here’s a better prompt: “Classify as URGENT only if there’s a time-sensitive request. Otherwise choose from INVOICE, CLIENT, NEWSLETTER, PERSONAL.” That way, your URGENT label actually means something.
Automation 2: The daily digest — your inbox in one email
Now let’s build a digest that arrives every weekday at 7:30am, summarising the last 24 hours of mail. This is a game-changer for freelancers and side hustlers. Set up a Schedule Trigger (cron: 30 7 * * 1-5). Then use a Gmail node with the ‘Search’ operation. The query is simple: newer_than:1d. That pulls all emails from the last day. Next, add an OpenAI node to summarise the list. The prompt: “Here are my emails from the last 24 hours. Summarise them into 5 bullet points. For each, state the sender, subject, and whether action is needed. End with a line: ‘Action required: yes/no’.” The output is a clean summary. Then use a Gmail node to send that summary to yourself. You can even add a filter to exclude newsletters — just add -category:promotions to the search query. The beauty of this is you don’t have to check email all day. You check once, get the digest, and decide what matters. I’ve been running this for six months, and my inbox anxiety has dropped to zero.
Automation 3: Context-aware auto-replies
Auto-replies get a bad rep because they’re usually “I’m on holiday” or “I’ll get back to you soon”. But with n8n, you can make them genuinely useful. The trick is to only reply when you’re away, and to include context. Build a workflow that triggers on new mail, checks if you’re in ‘away mode’ (you can toggle this with a simple flag in a Google Sheet or a database), and if so, generates a personalised reply. Here’s the flow: Gmail Trigger → Google Sheets (check away status) → If true → OpenAI (draft reply) → Gmail (send draft). The OpenAI prompt should include the original email and your away message template. For example: “I’m currently offline until Friday. Draft a polite reply to this email, acknowledging their message, and letting them know I’ll respond properly on Friday. Keep it under 100 words. Here’s the email: [email body].” The key is to not send the reply directly — instead, save it as a draft. That way, you can review it before it goes out. No one wants an AI accidentally promising a refund or a deadline you can’t meet. Use the Gmail node’s ‘Create Draft’ operation, then you can approve it on your phone in seconds. This turns a blunt auto-responder into a helpful assistant that keeps clients informed without sounding robotic.
Putting it all together — and a shortcut
By now you’ve probably got a mental picture of your own setup. But let me save you a few evenings of fiddling with nodes and JSON. If you want the done-for-you version of these exact workflows — pre-built, tested, and ready to import — I’ve packaged them into n8n Starter Workflows. It’s a set of plug-and-play templates you can import into n8n in minutes, covering smart labelling, daily digests, and auto-replies, plus a few bonus ones for Slack and Google Sheets. They start from just £9, which is less than an hour of your time, and they’re fully customisable. If you’d rather build from scratch, that’s cool too — but this is the fast track.
Hosting and costs — what you need to know
You’ve got two options: self-host on your own hardware or use n8n’s cloud. Self-hosting is free (software-wise) but you need a machine that’s always on. A Raspberry Pi 5 (about £60-£80 from Amazon, or you can grab one via this link) is plenty for personal use. You’ll also need a static IP or a tunnel like Cloudflare to access it remotely. Alternatively, a basic VPS from DigitalOcean or Hetzner costs around £4-£6 a month, and you can install n8n with a one-line script. The cloud version has a free tier, but it’s limited — for serious automation, you’ll want the self-hosted route. As for API costs, OpenAI’s gpt-4o-mini is dirt cheap — you’ll spend pennies a month for a few hundred emails. Gmail’s API is free. So your total monthly cost is basically your server. That’s it.
Final thoughts — start small, then scale
Don’t try to automate your entire inbox in one weekend. Start with the digest — it’s the easiest and gives you immediate value. Then add smart labelling. Auto-replies can come later once you trust the system. And remember: n8n workflows can be versioned, so you can tweak and improve them over time. The goal isn’t to never look at email — it’s to look at it on your terms. With these three automations, you’ll reclaim hours each week, and you’ll never miss a client invoice again. Give it a go — your future self will thank you.
If you want a head start, grab the n8n Starter Workflows and import them in minutes. Happy automating!
How Freelancers Use AI to Win Back a Working Day Every Week
Discover how UK freelancers are using AI tools to automate admin, speed up client communication, and reclaim a full day of focused work every single week.
ChatGPT Prompts for CVs, Cover Letters and Job Applications
Stuck on your CV or cover letter? These UK-tested ChatGPT prompts will help you tailor applications, beat the ATS, and land more interviews.
AI Prompts for Meeting Notes, Minutes and Action Points
Stop drowning in meeting admin. Here are the exact AI prompts that turn messy transcripts into clean minutes and action points — tested for UK teams and side hustlers.