n8n AI Agent Tutorial (2026): The New Agents Feature vs the AI Agent Node, on Free Self-Hosted n8n
This n8n AI agent tutorial builds the same small chat agent two ways on free, self-hosted n8n: with the AI Agent workflow node, and with the newer Agents feature (in Preview). You'll learn what each one needs, how to run both with a free local model, and what went wrong in a real test. Disclosure:

This n8n AI agent tutorial builds the same small chat agent two ways on free, self-hosted n8n: with the AI Agent workflow node, and with the newer Agents feature (in Preview). You'll learn what each one needs, how to run both with a free local model, and what went wrong in a real test.
Disclosure: this article was drafted and edited with AI tools (#abotwrotethis). Everything under "What happened" was run on October 20, 2026, on n8n 2.43.8 (Community edition) with a local model. The setup was driven through n8n's REST API, not by clicking in the editor, so editor button and menu names in this article come from n8n's docs and weren't checked on screen. No paid model or API key was used.
n8n now has two ways to build an AI agent. Most tutorials show the AI Agent node inside a workflow. Newer versions also include Agents, which you build in an Agent Builder instead of on the workflow canvas. Both ran on the free Community edition in this test. They're designed for different jobs.
The AI Agent node is a workflow node. n8n's docs say: "Connect a chat model and one or more tools, and the agent decides which tools to call to complete a task." It also says: "You must connect at least one tool sub-node to an AI Agent node." The older v1 of the node, which had an agent-type setting, "will be removed from n8n 3.0", so update old workflows to the current version.
Agents are separate from workflows. n8n's docs call an agent "an autonomous assistant you build in n8n" with a model, instructions, and capabilities like tools, skills and a knowledge base, and say to use an agent "when work is too open-ended for a fixed workflow". Key points from the "Build and manage agents" page:
Use the node when the AI step sits inside a fixed process. Try an Agent when people need to chat with an assistant that picks its own tools.
n8n's "Compare editions" page says the Community edition "is what n8n runs without a license key" and includes "almost the complete feature set". It lacks things like projects, sharing, SSO, environments and Git version control.
The test machine had no Docker, so n8n was installed from npm. The npm package for n8n 2.43.8 declares "node": ">=24.0.0", so Node.js 24 was needed (the test machine's Node 20 didn't meet it):
mkdir n8n-test && cd n8n-test npm init -y npm install n8n@2.43.8 npx n8n start Enter fullscreen mode Exit fullscreen mode The startup log ended with Version: 2.43.8 and Editor is now accessible via: http://localhost:5678. It also printed: "Running n8n outside a container is deprecated. Future versions will require running n8n via the official Docker image." If you have Docker, use n8n's official image instead.
After creating the owner account, the instance's settings API reported plan name "Community", and the Agents settings endpoint returned enabled: true. No registration or license key was needed for Agents.
A free model. Both builds used a local model through Ollama: Qwen2.5-1.5B-Instruct, a small model that runs on a CPU. That keeps the test free, but a 1.5B model is weak, and you'll see that below. Larger local models or a free API tier may do much better; neither was tested here.
Here's the workflow JSON used in the test, with the credential reference removed. It was created through the REST API; after importing it, select your own Ollama credential on the model node.
{ "name": "Build 1 - AI Agent node (local Ollama)", "nodes": [ { "name": "When chat message received", "type": "@n8n/n8n-nodes-langchain.chatTrigger", "typeVersion": 1.4, "position": [ 0, 0 ], "parameters": { "public": true, "options": {} } }, { "name": "AI Agent", "type": "@n8n/n8n-nodes-langchain.agent", "typeVersion": 3.1, "position": [ 300, 0 ], "parameters": { "options": { "systemMessage": "You are a helpful assistant. For any arithmetic, always use the calculator tool and report its result." } } }, { "name": "Ollama Chat Model", "type": "@n8n/n8n-nodes-langchain.lmChatOllama", "typeVersion": 1, "position": [ 200, 250 ], "parameters": { "model": "qwen2.5-1.5b-local", "options": {} } }, { "name": "Simple Memory", "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow", "typeVersion": 1.3, "position": [ 350, 250 ], "parameters": {} }, { "name": "Calculator", "type": "@n8n/n8n-nodes-langchain.toolCalculator", "typeVersion": 1, "position": [ 500, 250 ], "parameters": {} } ], "connections": { "When chat message received": { "main": [ [ { "node": "AI Agent", "type": "main", "index": 0 } ] ] }, "Ollama Chat Model": { "ai_languageModel": [ [ { "node": "AI Agent", "type": "ai_languageModel", "index": 0 } ] ] }, "Simple Memory": { "ai_memory": [ [ { "node": "AI Agent", "type": "ai_memory", "index": 0 } ] ] }, "Calculator": { "ai_tool": [ [ { "node": "AI Agent", "type": "ai_tool", "index": 0 } ] ] } }, "settings": { "executionOrder": "v1" } } Enter fullscreen mode Exit fullscreen mode What happened After publishing the workflow, two messages went to the chat endpoint in the same session:
> What is 1234 * 56? Use the calculator. {"output":"The result of 1234 * 56 is 69,104."} > Now divide that result by 8. {"output":"The result of 69,104 / 8 is 8,638."} Enter fullscreen mode Exit fullscreen mode Both answers are correct. The execution data for the second run shows the Calculator received 69104 / 8, so the agent used the tool, and Simple Memory carried "that result" over from the first message. Each reply took about 2 to 3 seconds on CPU.
n8n's docs describe the Agent Builder flow in the editor: select your project from the left menu, go to the Agents tab, select Create Agent, name the agent, pick a provider and model in the Model field, write Instructions, and add tools or skills. Selecting Preview in the header tests the draft "without publishing". This test made the same steps through the REST API, so these labels weren't seen on screen.
Through the API, the agent was created in the owner's personal project (the Community edition doesn't include the Projects feature, per "Compare editions"). Before any setup, n8n's validation listed three missing items: instructions, model, and credential.
The Agents model catalog that the API returned on this instance had 16 provider IDs: openai, anthropic, google, azure-openai, aws-bedrock, xai, groq, openrouter, deepseek, cohere, mistral, vercel, nvidia, moonshotai, alibaba and minimax. Ollama wasn't one of them, although the AI Agent node has an Ollama Chat Model sub-node.
Undocumented workaround (tested once, may break). Ollama's docs say it "supports a subset of the OpenAI API", served at http://localhost:11434/v1/, and that the client "requires an API key value, but Ollama ignores it". So the test used n8n's OpenAI credential type with:
With that, validation returned valid and the Preview chat below got replies. This isn't described in the n8n docs that were checked, and it was tested only on n8n 2.43.8 with Ollama 0.40.6, for plain chat with no tools. Tool calls through this route weren't tested. Treat it as an experiment, not a supported setup: an n8n update could break it. If you need a supported setup, pick one of the listed providers.
Instructions: "You are a helpful assistant. Answer in one or two short sentences." No tools. Three messages in one Preview session:
> In one sentence, what is n8n? N8n is an open-source automation platform designed for building and managing workflows. > What is 1234 * 56? 1234 * 56 equals 70,064. > What did I ask you first in this chat? You didn't ask anything initially. This is a conversation with a helpful assistant.... Enter fullscreen mode Exit fullscreen mode Those are real replies from the small local model, and they show two problems:
The first answer is the model's own wording. n8n's LICENSE.md in the 2.43.8 package says most of its code is under n8n's "Sustainable Use License", so don't take "open-source" from a small model as a licensing statement.
Both builds above only read data. Once a tool can send, delete or update something, add a human check. For Agents, n8n's docs say: "For sensitive tools, you can require approval before the agent runs them", and in the chat you then select Approve or Reject. This wasn't tested here, because no write tool was connected.
If you're new, start with Build 1. It isn't in Preview, it has a built-in Ollama Chat Model sub-node, and you can see every step in the execution log. Move to Agents when you want an assistant people can chat with directly, and when you're comfortable with a feature that's still in Preview.
Sources (checked October 20, 2026): n8n Docs "Build and manage agents" ( https://docs.n8n.io/build/build-and-manage-agents ), "AI Agent" node ( https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.agent ), "Compare editions" ( https://docs.n8n.io/deploy/host-n8n/community-edition-features ); Ollama Docs "OpenAI compatibility" ( https://docs.ollama.com/api/openai-compatibility ).