How to use n8n for free comes down to one choice: host it yourself. n8n's self-hosted Community edition is free and, in the company's words, comes with almost the complete feature set. n8n Cloud, the hosted version, offers a 14 day trial with Pro features and then moves to the paid Starter, Pro or Enterprise plans. (n8n Docs: Choose your n8n (opens in a new tab))
Here is the payoff. In about five steps you get an AI agent that answers in a chat window, decides on its own when to call a tool, and remembers the last few messages. All of it runs on n8n's official starter template and a free Google AI API key. (n8n: Build your first AI agent (template) (opens in a new tab))
Cloud or self-hosted: which n8n to pick
n8n's own comparison says self-hosting needs technical expertise for installation and configuration, and it recommends n8n Cloud to people who do not have that expertise. If you are comfortable typing a command in a terminal, the free edition is enough for this guide. If you register your email in the free edition, n8n unlocks a few extras: folders, debug in editor and custom execution data. (n8n Docs: Choose your n8n (opens in a new tab))
One more cost to know about: the AI model is billed separately from n8n. A tutorial from Techsy notes that the self-hosted Community edition has no execution limits, but any OpenAI, Anthropic or Gemini usage is charged by that provider. The Gemini key in this guide is free to create, which makes it the cheapest way to start. (Techsy: n8n AI agents tutorial (opens in a new tab); n8n: Build your first AI agent (template) (opens in a new tab))
Step by step: your first n8n AI agent
1. Install and start n8n
Install Node.js, version 20.19 to 24.x according to n8n's docs. Then open a terminal and run npx n8n to try it without installing anything, or npm install n8n -g followed by n8n start to keep it. Open http://localhost:5678 in your browser. n8n's docs say npm installs are deprecated starting with n8n 3.0, so if you plan to keep using it, the Docker route is the safer long-term setup.
2. Or start it with Docker
With Docker Desktop installed, create a volume with docker volume create n8n_data, then run the n8nio/n8n image with port 5678 open and that volume mounted to /home/node/.n8n, as the install page shows. Set GENERIC_TIMEZONE to your time zone so scheduled workflows run at the right hour. n8n's docs now point to Docker Compose as the recommended method for a lasting setup.
3. Get a free Google AI API key
Go to aistudio.google.com/app/apikey, click Create API key in new project and copy the key. n8n's starter template says this free key is the only thing you need to bring.
4. Load the starter agent and add the key
Open the Build your first AI agent template from n8n's template library. On the canvas, open the node named Connect your model (Google Gemini), choose Create New Credential in the Credential dropdown, paste the key into the API Key field and click Save. The template already wires a Chat Trigger to an AI Agent node, plus a Simple Memory node for follow-up questions and two tools: Get Weather and Get News, which reads an RSS feed.
5. Open the chat and test it
Go to the Example Chat node and click Open Chat in its panel. Ask for the weather in Paris, then ask for the latest tech news. A weather answer shows the Get Weather tool works; a list of headlines shows Get News works. Ask a follow-up question about the same city to check that memory is doing its job.
Build it yourself instead of using the template
n8n's blog walks through the same pieces by hand. Click the plus button on an empty canvas and add a Chat Trigger. Add an AI Agent node and connect the trigger to it. In the agent, choose Connected Chat Trigger Node as the source of the user message. Add a chat model node, such as Google Gemini, OpenAI or Anthropic, create its credential and connect it to the agent's Chat Model input. Tools go into the agent's Tool input. (n8n Blog: How to build your first AI agent (opens in a new tab))
The agent's behavior lives in the System Message, under Options in the AI Agent node. n8n's guide suggests stating the task, explaining when and how to use each tool, and adding constraints. Rename each tool node so its name matches the name you use in the System Message. (n8n Blog: How to build your first AI agent (opens in a new tab))
Prompt 1: A starter System Message
You are a research assistant.
When the user asks about the weather, call the [weather tool name] tool.
When the user asks for news, call the [news tool name] tool and return the 3 most relevant headlines with one line each.
If no tool fits the question, say you cannot check that. Never guess.Tip: After every test, open the execution in n8n and look at the AI Agent node's input and output. n8n's guide recommends this to see which tools the agent actually called. If it skipped a tool, the fix is usually a clearer System Message or a better description on the tool.
Where n8n agents struggle
The Techsy tutorial reports that agents get confused once they have more than about five to seven tools, that they can fail without an obvious error, and that n8n gives less control over agent design than code frameworks such as LangGraph or CrewAI. (Techsy: n8n AI agents tutorial (opens in a new tab))
n8n is a workflow tool first, and it shows. The practical answer is the same as with any agent: one narrow job, a few tools, and a test run before you trust it with anything real.
Tip: Keep your first agent read-only. Weather, news and summaries cannot do damage. Add tools that send email or write to a database only after you have watched a few executions and the agent calls the right tool every time.






