Skip to content

Build Your First AI Workflow in n8n This Weekend

This page may contain affiliate links.

If you have been meaning to dip a toe into AI automation but keep putting it off, n8n is the friendliest place to start. It is a visual workflow builder — you drag nodes onto a canvas, connect them, and wire up AI models, webhooks, email, spreadsheets and just about anything else with an API. Unlike some competitors, you can self-host it on your own machine or a cheap VPS, which means no per-task pricing surprises. This guide walks you through building a genuinely useful first workflow in a weekend: an AI-powered inbox triage bot that reads incoming emails, summarises them, tags them by urgency, and logs them to a Google Sheet.

Why n8n and what you will actually need

n8n sits in the sweet spot between "too simple to do anything interesting" and "you need to be a developer to touch it". The node-based interface means you can see exactly what data is flowing where, and the built-in AI nodes (LangChain-based) let you drop in OpenAI, Anthropic, Ollama or any compatible model without writing glue code.

To follow along you will need:

  • A computer (Mac, Windows or Linux — a laptop is fine)
  • Docker Desktop installed, or a free n8n cloud trial
  • An API key from an AI provider (OpenAI is the easiest starting point)
  • A Gmail account you do not mind connecting
  • A Google Sheet for the log

If you are self-hosting on a VPS, a basic 2GB RAM instance is plenty to start. If you want a slightly beefier box for running local models later, a mini PC with 16GB of RAM is a solid investment — you can browse options here: mini PC with 16GB RAM on Amazon UK.

Step 1: Get n8n running in under 15 minutes

The fastest route is Docker. Open a terminal and run:

docker run -it --rm \
  --name n8n \
  -p 5678:5678 \
  -v n8n_data:/home/node/.n8n \
  docker.n8n.io/n8nio/n8n

Then visit http://localhost:5678 in your browser. You will be asked to create an owner account — use a strong password, because this instance can reach your email and spreadsheets.

If you would rather not manage Docker, n8n offers a hosted cloud version with a free tier that is more than enough for a first workflow. Either way, you will be up and running inside a quarter of an hour.

Step 2: Build the AI email triage workflow

Here is the workflow we are building, node by node:

  1. Gmail Trigger — fires when a new email arrives in your inbox.
  2. Edit Fields (Set) — pulls out the subject, sender and body into clean fields.
  3. Basic LLM Chain — sends that content to the model with a prompt asking for a JSON response.
  4. Code node — parses the JSON so the next nodes can use it.
  5. Google Sheets — appends a row with sender, subject, summary, category and urgency.
  6. IF node — if urgency is "high", send yourself a Slack or Telegram message.

The prompt is the bit that matters most. Something like this works well:

You are an email triage assistant. Read the email below and reply with ONLY a JSON object, no prose, no markdown fences.

Fields:
- summary: one sentence, max 20 words
- category: one of [sales, support, admin, personal, spam]
- urgency: one of [low, medium, high]
- action: one short imperative sentence

Email:
Subject: {{ $json.subject }}
From: {{ $json.from }}
Body: {{ $json.text }}

Set the model node to use a small, cheap model — you do not need a frontier model for triage. Turn the temperature down to 0.2 so the output is consistent. In the Code node, use JSON.parse($input.first().json.text) and return the parsed object. If the model occasionally wraps the JSON in backticks, strip them with a quick .replace(/```json|```/g, '') before parsing.

Test it by sending yourself a few emails from a different account. Watch the executions panel — n8n shows you the exact data at every step, which is the fastest way to debug.

Step 3: Make it genuinely useful

A workflow that logs emails is nice. One that saves you time every day is better. Three upgrades worth doing before Sunday evening:

  • Batch your digests. Swap the immediate Gmail trigger for a Schedule trigger that runs at 7am and 6pm, pulls unread emails, and sends one summarised digest. Far less noisy than a ping per email.
  • Draft replies. Add a second LLM node that writes a suggested reply for anything categorised as "support" or "sales", and push it to Gmail as a draft. You review and hit send.
  • Add a fallback. Wrap the LLM node in an error branch that logs failures to a separate sheet, so a bad API response does not silently drop an email.

Keep an eye on token usage. For triage-style jobs with short emails, your running cost is typically a few pence per hundred emails, but check your provider's current pricing before you scale it up to a busy inbox.

If you would rather skip the trial-and-error phase and start from something that already works, our own n8n Starter Workflows pack gives you plug-and-play templates you can import in minutes — including an email triage flow very close to the one above. It is a sensible shortcut if you want the done-for-you version rather than building every node from scratch.

Step 4: Host it properly and keep it safe

Running n8n on your laptop is fine for learning, but if you want it to run while you sleep, move it to a small VPS. A basic instance from any UK-friendly host is inexpensive — think the price of a couple of coffees a month — and you can put it behind a reverse proxy with HTTPS using Caddy in about ten minutes.

Security basics that are easy to forget:

  • Never commit API keys to a public repo. Use n8n credentials, not hardcoded strings.
  • Restrict your Gmail OAuth scope to the minimum you need.
  • Set up regular backups of the n8n_data volume — a simple cron job copying it to cloud storage is enough.
  • If you expose the editor to the internet, put it behind a login and ideally a VPN or IP allowlist.

Conclusion

You do not need to be a developer to ship a useful AI workflow. In a weekend you can go from installing Docker to having an inbox assistant that reads, summarises and routes your email while you are doing something more interesting. Start with the triage workflow above, get it running end to end, then iterate — the second workflow is always faster to build than the first. Once you have felt the click of a workflow saving you twenty minutes a day, you will start spotting automations everywhere.

Written by

Richard Tucker

View all posts →