Every guide lists its sources, tips, and warnings. Read our editorial policy.

How to n8n Tutorial for Beginners: Build Your First Free AI Agent

A guide to Understand n8n and set up your workspace, Build a tiny workflow to learn the canvas, Connect a free AI model, Give your agent memory and tools, Trigger, deliver, and keep it running

Download checklist (PDF)
Interactive Step Checklist0 of 30 steps completed (0%)

If you have never opened n8n before, this is the guide to start with. We assume zero experience: no coding, no servers, no paid subscriptions. You will install n8n for free, build a two-node practice workflow so the canvas stops looking mysterious, then connect a free Google Gemini model and assemble an AI agent that remembers your conversation and uses tools to look things up. Every step has a picture and a link to the official documentation so you can check the exact screen. By the end you will have a working assistant you can chat with, plus the confidence to automate more. Browse the wider AI Automation and Agents category when you are ready for bigger builds.

How do you n8n Tutorial for Beginners: Build Your First Free AI Agent?

Overview: How to n8n Tutorial for Beginners: Build Your First Free AI AgentHowcompass | How to n8n Tutorial for Beginners: Build Your First Free AI Agent
Method1

Understand n8n and set up your workspace

A curious beginner studying a simple left-to-right flowchart of glowing boxes on a laptop, a friendly robot illustration beside the screen.Howcompass

Understand what n8n and an AI agent actually are

n8n is a free, fair-code automation tool: you drag boxes called nodes onto a canvas and connect them with lines, and data flows from one to the next. An AI agent is a special node that holds a language model plus a set of tools, then decides for itself which tool to call, reads the result, and keeps going until the task is done. That decision loop is the whole difference between a chatbot that only replies and an agent that actually does things. You do not need to understand the code underneath to use either. Read the plain-language definitions in the n8n glossary, and see how agents fit the bigger picture in the Artificial Intelligence library.

A person weighing three labelled option cards on a desk beside a laptop, a small balance scale drawn between cloud, container, and terminal icons.Howcompass

Choose how to run n8n: cloud, Docker, or npx

You have three free ways to start. n8n Cloud is a hosted trial that needs no install but expires; Docker runs n8n on your own computer forever and is the path this tutorial uses; npx starts it from a terminal if you already have Node.js. For a beginner who wants something permanent and private, Docker is the sweet spot because it bundles everything n8n needs into one download. Decide based on whether you want zero setup or zero cost long term, the same trade-off you weigh when auditing your monthly SaaS subscriptions. The official choose-n8n comparison lays out each option honestly.

A person watching a software installer progress bar on a laptop in a cozy study, a small whale sticker on the laptop lid.Howcompass

Install Docker Desktop the easy way

Download Docker Desktop from the official site and run the installer with the default options; on Windows accept the prompt to enable WSL 2 when it appears. Docker is the free container runtime that lets n8n run without you installing Node.js or databases by hand. Before you start, make sure the machine has at least 8 GB of RAM and a couple of gigabytes of free disk, because a cramped computer makes everything feel broken. If yours is sluggish, speed up a slow laptop and free up disk space first. The Docker Desktop documentation shows the installer for every platform.

A person typing a single command into a dark terminal window on a laptop, a small external hard drive connected beside it.Howcompass

Launch n8n with a persistent volume

Open a terminal and create a storage volume with docker volume create n8n_data, then start n8n with docker run -it --rm --name n8n -p 5678:5678 -v n8n_data:/home/node/.n8n docker.n8n.io/n8nio/n8n. The volume is the part beginners skip and later regret: it keeps your workflows and credentials when the container stops, so your work survives a restart. Treat that volume like any data worth protecting and back up your computer to an external drive on a routine. The first launch downloads the image and takes a few minutes. The n8n Docker installation guide lists the same command with every current option.

A person filling a first-run account form on a laptop, a phone standing next to the keyboard showing a password manager app.Howcompass

Create your owner account at localhost:5678

When the terminal settles, open http://localhost:5678 in your browser and create the owner account n8n asks for on first launch. This login lives only on your machine; nothing is sent to n8n the company. Use a real, unique password rather than a throwaway, because this one account guards every API key and credential you will store later. A password manager with a recovery plan is the right home for it, exactly as for your email and banking. The n8n security overview explains how user accounts and access work as you grow.

A person pointing at the different areas of a laptop workflow editor, a simple annotated canvas with a plus button and a side panel.Howcompass

Tour the editor: canvas, nodes, and panels

Spend two quiet minutes looking at the empty workflow before building anything. The big grey area is the canvas where nodes live; the plus button adds a node; the right-hand panel shows a selected node's settings; and the Executions tab records every run. Data always flows left to right, which is why the trigger sits at the far left and the result lands at the far right. Click around without fear, because nothing runs until you press the test button. A comfortable seat and screen height make this exploration pleasant, so set up an ergonomic home office if you will be here a while. The n8n workflows documentation walks through the same interface.

A person adjusting a round wall clock beside a laptop showing a schedule settings panel, a steaming cup of coffee on the desk.Howcompass

Set your timezone before you schedule anything

Stop the container and restart it with -e GENERIC_TIMEZONE=Europe/Berlin -e TZ=Europe/Berlin added to the docker run command, swapping in your own zone. Without this, n8n schedules run on UTC, so a digest you meant for 8 am arrives at the wrong hour, which is the most common beginner bug with scheduled workflows. Fixing the boring default now saves an hour of confusion later, and it means your morning automation actually lands in the morning alongside a healthy sleep and morning routine. The environment variable reference lists every setting you can pass this way, and more daily automations live in the AI Productivity and Office category.

Method2

Build a tiny workflow to learn the canvas

A person placing a play-button trigger node at the far left of a laptop canvas, a single arrow pointing right toward empty space.Howcompass

Start with a Manual Trigger

Before any AI, build a two-node practice workflow so the canvas becomes familiar. Click the plus button, search for Manual Trigger, and add it; this node simply starts the workflow when you press the test button, which is perfect for learning because nothing runs on its own. Every workflow begins with exactly one trigger, and the manual one is the safest place to start since you control each run. Think of it as the light switch for everything to its right. The Manual Trigger documentation shows its few options, and the same trigger-first pattern appears in every build in the AI Automation and Agents category.

A person typing a labelled field into a settings panel on a laptop, a small card sliding from one node into the next.Howcompass

Add an Edit Fields (Set) node

Click the plus to the right of the trigger, search for Edit Fields, and add it; older tutorials call this the Set node. It lets you create or change fields in the data passing through, so add a field named greeting with the value Hello from my first workflow. This is the simplest possible transformation: data comes in, you adjust it, data goes out. Structuring information into clear named fields is a habit that pays off everywhere, the same discipline as keeping a Zettelkasten slip box where every note has a place. The Edit Fields documentation explains each mode.

A person reading a small block of structured output on a laptop with a magnifying glass, two green nodes glowing on the canvas.Howcompass

Run it and read the output JSON

Press the test button and watch both nodes turn green, then click the Edit Fields node to see its output: a small block of JSON containing your greeting field. JSON is just labelled data written as key and value pairs, and reading it is the single most useful debugging skill in n8n. Do not be intimidated by the brackets; you only need to find the field you care about. Get comfortable reading structured output the way you would read a research paper without being fooled: scan for the part that matters. The n8n data structure guide explains items and JSON with pictures, and more logic builds live in the AI Coding and Development category.

A person dragging a data field from a laptop input panel into a settings box, a small placeholder tag glowing where it lands.Howcompass

Understand items, fields, and expressions

Here is the one concept that unlocks everything else. n8n passes data as a list of items, each item is a bundle of fields, and an expression is a small placeholder that pulls a field's value into a setting, written like {{ $json.greeting }}. You rarely type these by hand: dragging a field from the input panel on the left writes the expression for you. Your instruction stays fixed while the data changes each run, which is exactly how the AI agent later reads fresh input. If a new term sticks, explain it aloud in your own words, the Feynman technique for making it permanent. The expressions documentation has gentle examples.

A person rolling a workflow blueprint into a scroll and placing it in a backup box beside an external drive and a laptop.Howcompass

Name, save, and duplicate your workflow

Click the workflow title at the top and rename it to My first practice, then press save. Open the three-dot menu and download it as JSON so you have a copy on disk, and use Duplicate before any experiment so a broken test never costs you the working version. These three habits, naming, saving, and duplicating, are the cheapest insurance in automation and take five seconds. Fold the downloaded file into the routine in setting up encrypted automated cloud and local backups so it lives alongside your other important files. The export and import documentation shows the exact menu paths, which shift occasionally between versions.

Method3

Connect a free AI model

A person carefully copying a long API key from a browser window into a password manager on a laptop, focused expression.Howcompass

Create a free Gemini API key

Sign in at Google AI Studio with any Google account and create an API key; the Gemini API free tier needs no credit card and is generous enough for a personal agent. Copy the key somewhere safe the moment it appears, because you will paste it into n8n shortly. Only ever create keys on Google's own domain, since fake key-generator sites are a classic phishing trick of the kind covered in recognizing and avoiding phishing emails and fake websites. Google's API key documentation shows the exact screens, and the AI Models and Technology category explains how the model families differ.

A person pasting an API key into a credential form on a laptop, a padlock icon visible in the corner of the screen.Howcompass

Save the key as an n8n credential

In n8n, open Credentials in the left menu, choose Add credential, search for Google Gemini(PaLM) Api, and paste the key there rather than into any node field. Credentials are stored separately from workflows, so when you later export or share a workflow the key does not travel with it, which is exactly what you want. Name it clearly, for example Gemini free tier, so you can tell providers apart at a glance. Treat every API key like a password in your password manager and recovery plan, because anyone holding it spends your quota. The Google credentials documentation shows where each Google key type belongs.

A person placing a glowing robot-shaped node onto a laptop canvas, three empty slots visible beneath it waiting to be filled.Howcompass

Add the AI Agent node

Start a fresh workflow, click the plus button, search for AI Agent, and add it; it lives in the Advanced AI section and is the brain of this build. Unlike a plain node, the agent has empty slots underneath it for a chat model, memory, and tools, and it decides at runtime which of those to use. You do not wire the logic yourself; the model reads your prompt and picks. This is the moment your practice canvas turns into something that can reason. The AI Agent node documentation explains each slot, and when you want a bigger scheduled build later, Build an AI Agent with n8n for Free is the natural next step in the AI Automation and Agents category.

A person connecting a brain-shaped model chip into the slot beneath a robot node on a laptop canvas, a cable of light between them.Howcompass

Attach the Gemini Chat Model

Click the Chat Model slot under the agent and choose Google Gemini Chat Model, then select the credential you saved and a Flash-family model such as gemini-flash-latest. Flash models are the right default for a free first build: they are fast, capable enough for tool use, and generous on the free tier, while the larger Pro models burn quota quickly. You can swap models later without touching the rest of the workflow, so do not overthink the choice now. The Gemini Chat Model documentation lists the available models, and the AI Models and Technology category covers when an upgrade is actually worth it.

A person writing a structured prompt in a notebook beside a laptop, four short labelled lines visible as abstract strokes.Howcompass

Write your first system prompt

Open the agent's Options, add a System Message, and write the job in plain English: the role, the task, the output format, and the limits. For a first assistant try: You are a friendly study helper. Answer questions clearly in under 150 words, use a tool when you need a fact or a number, and say so when you are unsure. Vague prompts produce vague agents, so be as specific as you would when writing clear emails to a new colleague: role, task, format, deadline. This one field does more for quality than any model upgrade, and the same clarity makes an agent's output as usable as an email that actually gets a reply. The Advanced AI guide shows more prompt patterns.

A person reading a short chat reply on a laptop with a satisfied expression, a green checkmark glowing beside the message.Howcompass

Test the agent in the chat panel

Open the agent node and use its built-in chat panel to type a simple question such as Explain what a workflow trigger is in one sentence, then run it. A coherent reply means the key, credential, and model are wired correctly. If you see a 401 error the key is wrong or revoked, and a 429 means you hit the free-tier rate limit and should wait a minute before retrying. Fix connection problems now, before memory and tools complicate the picture. Long debugging sessions are exactly when relieving screen eye strain pays off, so take the breaks. The Chat Trigger documentation covers the chat interface, and the AI Tools and Platforms category has more setup guides if your provider's screens have changed.

Method4

Give your agent memory and tools

A person sliding a small memory box into the slot under a robot node, a short string of connected note cards trailing behind it.Howcompass

Add Simple Memory so it remembers

Click the Memory slot under the agent and add Simple Memory, then set the context window to around ten messages. Without memory every message is a first message; with it the agent can handle follow-ups like make that shorter or explain the second point again. Ten to twenty messages is plenty for a personal assistant and keeps token usage inside the free tier. It is the same principle as a Zettelkasten slip box: useful notes need a place to live and a way to be recalled. The Simple Memory documentation explains session keys if you later serve several users.

A person handing an open encyclopedia to a small robot on a laptop canvas, the robot reading while a question bubble floats above.Howcompass

Add a Wikipedia tool for facts

Click the Tool slot under the agent and add the Wikipedia tool, which lets the model look up factual articles instead of guessing from memory. With it attached, a question like what is the capital of Slovenia becomes a real lookup rather than a confident hallucination. Language models are fluent but not always accurate, so giving them a source to check is the single biggest quality upgrade you can make for free. It is the same habit as vetting a claim you read online before you share it. The Wikipedia tool documentation shows its settings, and more research helpers live in the AI Research and Learning category.

A person handing a calculator to a small robot on a laptop canvas, the robot holding it beside an open encyclopedia.Howcompass

Add a Calculator tool for numbers

Add the Calculator tool from the same Tool slot, because language models guess arithmetic and dates unless a tool computes them. With Wikipedia plus Calculator attached, a question like what is the population density of Portugal becomes a lookup followed by a division instead of a plausible-sounding wrong number. This matters any time money or measurements are involved, the same reason you manage personal finances and budget with real figures rather than estimates. Test with a question that needs both tools and watch the agent chain them on the canvas. The Calculator tool documentation explains the expressions it accepts, and the AI Research and Learning category covers more ways to keep answers honest.

A person attaching a small wrench-shaped tool to a robot node on a laptop canvas, the robot's arm extending toward a globe icon.Howcompass

Add an HTTP Request tool for web pages

Add the HTTP Request Tool so the agent can fetch the full text of a URL you provide, which turns it into a simple summarizer of any page you paste. Leave the method on GET for reading and let the model fill in the URL from your message. This is the agent's first real reach into the live web, so keep it read-only while you learn. Reading a fetched page critically is the same skill as reading a research paper without being fooled: check what the source actually says before trusting the summary. The HTTP Request Tool documentation covers its options, and the wider Computers and Electronics library covers the machine and network underneath.

A person writing a short instruction label beside each of three tools on a laptop canvas, a robot reading the labels thoughtfully.Howcompass

Write tool descriptions the model can read

The most overlooked setting is each tool's description, because the model chooses tools by reading descriptions, not by inspecting their configuration. A vague description never gets called; a precise one like Fetch the full text of a URL the user provides so you can summarise it gets called at exactly the right moment. Write each description as a clear instruction to a new colleague, the same clarity you bring to writing clear emails. Spend more time on these few sentences than on any other setting, because they decide whether your tools are used at all. The HTTP Request node documentation shows the fields, and the AI Writing and Content category covers what to do with the summaries once they arrive.

A person setting a small fence and gate around a robot node on a laptop canvas, a shield icon hovering over the tools slot.Howcompass

Set safety limits: iteration cap and read-only tools

Open the agent's Options and set maximum iterations to five or ten so a confused model cannot loop forever and burn your free quota in minutes. More importantly, remember that any page the agent reads can contain hidden instructions aimed at it, a prompt-injection attack, so keep tools read-only while you learn. Never attach a tool that sends email or deletes files to an agent that also reads arbitrary web pages. The social-engineering mindset in recognizing phishing emails and fake websites applies directly: the agent is a new employee who believes everything it reads. The n8n security overview covers safe defaults, and the AI Safety and Privacy category goes deeper.

Method5

Trigger, deliver, and keep it running

A person chatting with a robot agent in a laptop chat window while nodes on the canvas behind it light up in sequence.Howcompass

Add a Chat Trigger to talk to your agent

Add a Chat Trigger node and connect it to the agent's input, then click Open Chat to talk to your build in a proper chat window instead of the node panel. Ask a multi-step question that forces tool use, for example look up the area and population of Slovenia and calculate its density, then ask a follow-up to prove memory works. Watch the canvas light up each node as it runs; that visual trace is your best debugging tool. This chat-first build is the gentle starting point, and when you are ready to put an agent on a schedule, Build an AI Agent with n8n for Free shows the next level. The Chat Trigger documentation covers its options, and more builds live in the AI Automation and Agents category.

A person receiving a glowing message from a robot node on a laptop canvas, a phone buzzing beside the keyboard.Howcompass

Deliver answers to Telegram or Gmail

Add a Telegram node after the agent to push answers to your phone, or a Gmail node to email them to yourself; Telegram is simpler because a bot token from BotFather is all it needs. Map the agent's output field into the message body, run once, and check your inbox before trusting it. An assistant whose output nobody reads is just an expensive screensaver, so delivery is what makes the build useful. If you later point the agent at other people, writing an email that actually gets a reply is worth a read. The Telegram node documentation shows the auth steps, and the AI Productivity and Office category covers more ways to route output where you will see it.

A person setting a round alarm clock node at the left edge of a laptop canvas, a sunrise visible through the study window.Howcompass

Add a Schedule Trigger for a daily run

When you want the agent to work without you, add a Schedule Trigger set to every day at 08:00 as an alternative to the chat trigger. A schedule turns a toy you talk to into a service that delivers, and the timezone you set in part one decides when 08:00 actually happens. Pair it with a fixed prompt, for example a short morning briefing on a topic you are studying, so it lands alongside your healthy sleep and morning routine rather than interrupting it. Use the cron option for weekday-only runs. The Schedule Trigger documentation lists every interval option, and more daily automations live in the AI Productivity and Office category.

A person examining a laptop execution log with a magnifying glass, one node glowing red among green nodes on the canvas.Howcompass

Read execution logs to debug failures

Open the Executions tab, click the latest run, and inspect each node's input and output by clicking it on the canvas. Green means success, red means error, and the red node's panel shows the exact message the provider returned. Nine times out of ten a failure is an expired key, a renamed field, or a rate limit, and the log tells you which in seconds. For failures that retries cannot fix, add a Stop and Error node on a failure branch so the problem is recorded rather than silently swallowed. Reading logs calmly is a skill that transfers to every automation you build, and it helps to relieve screen eye strain during long sessions. The Stop and Error documentation shows the pattern, and the AI Coding and Development category covers more debugging.

A person flipping a glowing toggle switch on a laptop while a small robot works alone at the canvas, moonlight mixing with the desk lamp.Howcompass

Activate and verify one unattended run

Flip the Active toggle in the top-right corner, then wait for the next scheduled time and confirm a successful execution appears without you touching anything. Activation also switches webhooks from test URLs to production URLs, which is why a workflow that worked in the editor can behave differently once live, so check the first unattended run end to end including delivery. If a run never fires, confirm the machine is awake and online, the same checks you would test a home internet connection and fix Wi-Fi dead zones. The Webhook node documentation explains test versus production URLs, and the AI Productivity and Office category has more workflows worth activating once this one runs cleanly for a week.

A person locking a small server-room door while a robot works at a laptop inside, a backup box and a round gauge in the green zone nearby.Howcompass

Back up, secure, and stay inside free limits

Finish with three habits that keep the build alive. Export the workflow JSON and back up the n8n_data volume into your encrypted automated cloud and local backups. Never port-forward 5678 to the internet; keep it on localhost or behind authenticated HTTPS, and segment your network the way a separate guest Wi-Fi network does for visitors. Finally, check the Gemini pricing and free-tier page and keep your schedule well under the daily caps; the iteration cap from part four is your safety valve. The AI Safety and Privacy category covers the wider discipline. Your first agent now works for you, and the last job is making sure nobody else can hire it.

Frequently Asked Questions

Question: Is n8n really free for beginners?

Yes for this build. The self-hosted community edition is free under n8n's fair-code license and includes the AI Agent node, memory, and tools. You pay only if you exceed a model provider's free tier or choose n8n's paid cloud hosting instead of running it yourself.

Question: Do I need to know how to code?

No. The whole build is drag-and-drop, the system prompt is plain English, and n8n writes the data expressions for you when you drag fields from the input panel. Code nodes exist for later, but nothing in this beginner tutorial requires them.

Question: Which AI model can I use for free?

Google's Gemini API has a free tier aimed at exactly this kind of personal project, and Groq and OpenRouter also offer free access to open models within daily limits. This tutorial uses Gemini Flash as the default because it is fast and generous on the free tier.

Question: What is the difference between an AI agent and a chatbot?

A chatbot answers messages. An agent is given a goal and tools, then decides for itself which tools to call, reads the results, and loops until the job is done. In n8n the AI Agent node is that decision loop, and the tools you attach are its hands.

Question: Will the agent run when my computer is off?

No. A self-hosted n8n only runs while its machine is on, so a scheduled agent needs an always-on computer: an old laptop, a small home server, or a cheap VPS all work. If you want zero maintenance, n8n's paid cloud is the alternative.

Question: I already finished this. What should I build next?

Move from a chat assistant to a scheduled service. Our follow-up guide, Build an AI Agent with n8n for Free, walks through an agent that fetches fresh input on a timer, summarises it, and delivers a digest to your inbox every morning without you touching it.

Tips

  • Build the two-node practice workflow first even though it feels trivial; ten minutes on the canvas makes the AI steps feel obvious instead of magical.
  • Name every node as you add it, like Fetch page or Summarise, so future you reads the canvas at a glance instead of opening ten panels.
  • Start with one tool and add more only when a chat test shows a real gap; every extra tool is another description the model can misread.
  • Keep a scratch workflow for experiments and duplicate a working flow before any big edit, so a broken test never costs you the build.
  • Free-tier quotas reset daily, so schedule heavier jobs shortly after the reset rather than at the end of the day when the budget is spent.

Warnings

  • API keys are money: anyone holding your key spends your quota and can impersonate your agent, so never paste keys into screenshots, public forums, or shared workflow exports.
  • Web pages the agent reads can carry hidden instructions aimed at the model, a prompt-injection attack; keep tools read-only until you fully trust the flow.
  • Free tiers are not for sensitive data: providers may log or train on free-tier traffic and can change limits without notice, so keep personal and client data out of the prompts.
  • An n8n port exposed to the internet hands strangers your stored credentials; keep it on localhost or behind authenticated HTTPS, never raw port-forwarding.

Things You'll Need

  • A computer with 8 GB of RAM and 2 GB of free disk space
  • Docker Desktop on Windows or macOS, or Docker Engine on Linux
  • n8n community edition, self-hosted and free
  • A Google account and a free Gemini API key from AI Studio
  • Optional: a free Groq or OpenRouter account as a backup provider
  • A Telegram or Gmail account for delivering the agent's output
  • A password manager for the owner account and the API keys
  • Sixty to ninety minutes for the first complete build

References (7)

  1. Install n8n with Dockern8n Docs
  2. AI Agent node documentationn8n Docs
  3. Advanced AI in n8nn8n Docs
  4. Gemini API key documentationGoogle AI for Developers
  5. Gemini API pricing and free tierGoogle AI for Developers
  6. Docker Desktop overviewDocker Docs
  7. n8n community forumn8n Community

Sources are listed so you can read the underlying guidance yourself. Our editorial policy explains how guides are reviewed.

Did this article help you?

0 readers found this helpful — add your vote.

Reader Comments (0)

No comments yet — be the first to share your results.