A Beginner's Guide to n8n: Your First AI Workflow in 30 Minutes
Your first AI workflow in n8n takes about twenty minutes: install n8n with one Docker command, add a Webhook trigger, connect an OpenAI or Ollama node, add a response node, and click activate. That is the whole arc. Everything past that is variation on the same five nodes.
What n8n actually is
n8n is an open-source workflow tool where you wire together nodes that trigger, transform, and send data. Each node is one step. The canvas is the program. Think of it as drag-and-drop scripting with batteries included for the 1,000 most common integrations.
The first workflow that made it click
September 2023, my first week with n8n. I had been hand-tagging incoming feedback for a small product. Maybe 40 emails a week, three categories, total time around ninety minutes of grunt. I built a four-node workflow on a Saturday morning, coffee in hand: Gmail trigger, OpenAI node with a one-line classification prompt, Switch node, three Gmail label nodes. By lunchtime it was running. By the following Friday it had tagged 38 emails, missed two that I had to retag by hand, and given me my Sundays back. I have built dozens of workflows since. The first one taught me more than the dozens.
The opinion for new builders
Do not start with a complex workflow. Start with the smallest workflow that touches your real life. The mechanism: small workflows finish, finished workflows teach, taught builders ship the bigger ones. The cost of being wrong is six weekends spent on an ambitious workflow that never goes live. Hold this loosely if you already build software for a living; then a slightly bigger first project is fine. For everyone else, start tiny.
Install n8n in one command
If you have Docker: docker volume create n8n_data && docker run -it --rm --name n8n -p 5678:5678 -v n8n_data:/home/node/.n8n docker.n8n.io/n8nio/n8n. Open http://localhost:5678 in the browser. Sign up locally. You are in. If Docker is not your thing, the n8n desktop app installs in a click on macOS and Windows.
The five nodes of a first workflow
- Trigger — start with the Webhook node. It gives you a URL you can hit from anywhere, including a test from Postman or curl. Faster to iterate than a real integration trigger.
- AI step — the OpenAI node (or Ollama Chat Model if you have it running locally). Drop in a short prompt. Connect the input data using n8n's expression syntax: {{ $json.body.text }}.
- Decision — the Switch node lets you route based on the AI's answer. Start with two branches; you do not need more.
- Action — Gmail, Slack, Notion, HTTP Request, whatever you want the workflow to do.
- Response — Respond to Webhook node sends a result back to whoever called the trigger. Optional but useful for debugging.
The mistake every new builder makes
Wiring the workflow before testing each node individually. n8n has a test execution button on every node. Use it. Click the trigger, see the data, click the AI step, see the result, click the next node, see the output. Build one node at a time and you will rarely spend more than ten minutes debugging anything. Build all five then click execute and you will spend an hour figuring out which one broke.
The prompt that almost always works
For classification: "You are a classifier. Categories: A, B, C. Input below. Return only one word: A, B, or C." Then the input. Temperature 0. Max tokens 5. Output validation in the next node: if the model returns anything not in the enum, route to a fallback branch. This single pattern handles 80% of the AI steps I have ever shipped.
Cost expectations for a first workflow
OpenAI's GPT-4o-mini at October 2025 pricing is $0.15 per million input tokens and $0.60 per million output. A typical classification call uses roughly 100 input tokens and outputs 5. At 1,000 classifications a day, monthly cost lands around $0.50. Your first month on the OpenAI bill, if you are not careful, will probably still be under five dollars. The free tier of n8n Cloud or self-hosted is free.
The AI Agent node path, which the official docs lead with
The official tutorial at docs.n8n.io/advanced-ai/intro-tutorial does not start where my walk-through above starts. It starts with the AI Agent node connected to a Chat Trigger, which gives you a working chat-style agent in about six clicks. That is the right path if your first workflow is a conversational helper. The Webhook plus classification path I used above is the right path if your first workflow is a one-shot transformer like inbound email triage. Both belong in your toolkit. The denofdevs piece ("Build Your First Free AI Agent in 2025") points out something else worth knowing on day one: the n8n template library has well over a thousand starter workflows, many of them AI-flavoured. Browse those before you build from scratch. Half the work is often already on the canvas.
Frequently asked questions
n8n Cloud or self-hosted?
Cloud if you want zero setup. Self-hosted if you want full control, no execution limits, and a flat monthly cost. For your first workflow, Cloud's free tier is more than enough. Self-host later if it matters.
Do I need to code?
Mostly no. The Function and Code nodes let you write small JavaScript or Python snippets, and you will eventually want to, but the first dozen workflows usually need none. n8n's expression syntax for referring to data is the only thing you have to learn early.
How do I share a workflow?
Click the workflow menu and export as JSON. Share the JSON. The recipient imports it. Credentials do not travel; the recipient sets their own. There is also a public workflow library at n8n.io/workflows with hundreds of starter templates.
What is the next thing to build after my first?
Pick something that takes you 20 minutes a week and that follows a predictable pattern. Email triage, lead routing, calendar summaries, weekly digest emails, RSS-to-Notion pipelines. The second workflow teaches you what the first did not, and the third feels almost lazy.
Open the canvas. Drop the five nodes. Click execute. The rest is just more nodes.