How to create an AI Agent with n8n in 2026

n8n is an open-source workflow automation tool that easily integrates with AI agents. This guide provides instructions for installing Docker Windows and building a free chat agent (2026).

n8n is an extremely powerful open-source workflow automation tool that allows you to connect hundreds of applications such as Google Sheets, Telegram, Notion, OpenAI, etc., without writing complex code. With its node-based drag-and-drop interface, n8n allows you to create intelligent automated workflows, and it integrates AI agents to build AI chat assistants, process data, send notifications, and more.

 

Compared to Zapier or Make.com, n8n stands out because it's free when self-hosted , highly flexible (supports JS/Python code), low-cost (based on execution workflow), and more secure because you control your data. It's a top choice for developers, small businesses, or anyone wanting to automate with AI without breaking the bank.

 

Why create an AI agent?

To put it simply, we can compare a regular AI and an AI Agent to the difference between an "encyclopedia" and a "professional personal assistant" .

Below is a comparison table with real-world examples of "Travel Planning" :

 

Here's a more relatable example from the workplace:

1. The Normal AI Model (Writing an article):

You provide the topic, and the AI ​​writes a blog post for you. Then, you have to manually copy the post, find accompanying images, upload it to your website, and share it on social media.

2. AI Agent (Total Automation):

You just need to provide the topic. The AI ​​Agent will automatically perform the following sequence of actions:

  • Step 1: Search for the latest information on Google.
  • Step 2: Write your own SEO-optimized articles using the latest Google structure.
  • Step 3: Create illustrations in Canva that are suitable for the content of your article.
  • Step 4: Automatically publish articles to WordPress during peak hours.
  • Step 5: Send a notification to the work group to report: "I've finished posting!".

In short: If normal AI is the "brain," then AI Agent is the "brain with added hands and access to tools . "

The outstanding advantages of using n8n

  • Free & self-hosted : Install locally or on a private server, no execution limitations like Zapier (potentially saving 10-50 times the cost when scaling).
  • Highly flexible : Supports over 400 built-in integrations, custom nodes, JS/Python code, and powerful AI agents (connects to LLMs like OpenAI, Gemini, Groq.).
  • Deep AI integration : Building AI chat agents, RAG chatbots, automation with tools (web search, calculations), and memory to remember context.
  • Security & Customization : Data is stored locally, easy to back up, suitable for businesses that need control.
  • Strong community : Thousands of ready-made workflow templates, regularly updated (version 2.x in 2026).

 

Guide to installing n8n on Windows 11 using Docker (easiest way 2026)

  1. Install Docker Desktop : Download from docker.com, select WSL 2 backend → install and restart if necessary.
  2. Update WSL if errors occur : Open PowerShell (admin) → wsl --update.
  3. Open Docker Desktop → Images tab → search n8nio/n8n → Pull latest.
  4. Click Run → Optional settings:
    • Container name: n8n
    • Ports: Host 5678 → Container 5678
    • Volumes: Create a volume with the directory path containing the n8n data on your computer → mount /home/node/.n8n
    • Environment: GENERIC_TIMEZONE - Asia/Ho_Chi_Minh, N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS = true, N8N_RUNNERS_ENABLED = true
  5. Run → Containers tab, see Running → access http://localhost:5678 → setup email/password.
  6. If you encounter a port/firewall error: Temporarily disable Windows Firewall or change the port to 5679.

See more details in this article: How to install and use n8n on Windows 11

How to build an AI Chat Agent with n8n

Construction steps

1. Creating a new workflow: When you open n8n, you will see:

  • A blank canvas (if this is your first time logging in).
  • Or from the Workflows list → click the + button to create a new one.

Images 1 of How to create an AI Agent with n8n in 2026

 

2. Add a Trigger node to any workflow that needs a starting point. Here, we use a Chat Trigger (a button that activates when a chat message arrives).

Images 2 of How to create an AI Agent with n8n in 2026

  • Click Add first step or press the N key to open the node menu.
  • Type "Chat Trigger" into the search bar → select it.

Images 3 of How to create an AI Agent with n8n in 2026

  • The node will appear on the canvas. Close the node details window to return to the canvas.

Images 4 of How to create an AI Agent with n8n in 2026

What is a Chat Trigger ? It waits for you to type a message to run the workflow. In practice, you can attach it to the public chat of n8n or embed it into a website. Here, we'll use the local chat for testing – no additional installation is needed.

3. Add the AI ​​Agent node. This is the "heart" of the AI ​​in the workflow.

Images 5 of How to create an AI Agent with n8n in 2026

 

  • Click the + (Add node) icon on the right side of Chat Trigger.
  • Type "AI" → select AI Agent .

Images 6 of How to create an AI Agent with n8n in 2026

Images 7 of How to create an AI Agent with n8n in 2026

  • The node editing window opens. With Chat Trigger, the default prompt settings are already okay and don't need to be changed.

4. Configuring the AI ​​Agent node: The AI ​​Agent needs to be assigned a chat model (language model) to process messages.

Images 8 of How to create an AI Agent with n8n in 2026

  • Click the + sign under Chat Model (the first connection under the node).
  • A menu will appear; filter by "Language Models".

Images 9 of How to create an AI Agent with n8n in 2026

  • Choose the OpenAI Chat Model (or Gemini, Groq… if you prefer and feel it suits your work needs). Note that each model requires you to have its API Keys to use it in the AI ​​Agent on n8n.
  • The OpenAI node will attach to the AI ​​Agent and open the editing window.
  • In the Model section , select a model (for example, gpt-4o-mini – free for OpenAI basic accounts).

 

What is a chat model? It's the "brain" that generates text from prompts. Each model has its own strengths depending on the training data (for example, OpenAI excels in English, Gemini is strong in multiple languages.).

5. Add Credentials (login information – if needed). n8n requires an API key to connect to OpenAI (or another model).

  • If you already have OpenAI credentials, they will appear automatically.
  • If not already set: Click "Select credential" → "Set up credential".

Images 10 of How to create an AI Agent with n8n in 2026

  • Simply paste the API key (long string) from the website of your chosen model.
  • Note: Keep your API key confidential; do not share it.

For example, in the image below, I've chosen OpenRouter as the AI ​​Agent model. To obtain API Keys to use OpenRouter within the n8n AI Agent, I need to access the official OpenRouter website, find the section for creating API Keys, and select "Create."

Images 11 of How to create an AI Agent with n8n in 2026

Please fill in the information such as the API Key name, the maximum Credit amount that can be used for this API Key, the reset time when the limit is reached, and the validity period of this API Key. Finally, select Create to get the API Key.

Images 12 of How to create an AI Agent with n8n in 2026

Once you receive the API code, go back to the AI ​​Agent creation interface on n8n, select the AI ​​model (here I chose OpenRouter), and then select

Images 13 of How to create an AI Agent with n8n in 2026

Next, after adding the AI ​​model, you can add other items such as Tools, storage, Google Calendar, and any other data you frequently use for your work so that the AI ​​Agent can function accurately.

Images 14 of How to create an AI Agent with n8n in 2026

6. Test

  • Click the Chat button below the canvas → the chat window opens on the left, the AI ​​log is on the right.
  • Type any message → Press Enter → AI will reply immediately.
  • The log section displays the input/output of the AI ​​Agent (very useful for debugging).

7. Change the System Prompt (the AI's "personality"). By default, the AI ​​starts with the message: "You are a helpful assistant."

  • Open the AI ​​Agent node.
  • Bottom section: Options → click Add Option → select System message .
  • Change the prompt, for example: "You are a talented poet, always responding with rhyming couplets."
  • Close the node → return to chat → ask again → see the AI ​​responds in a new way!

8. Add Persistence (memory – so AI remembers conversations). Currently, AI "forgets" everything after each message. For example: You say "My name is Minh," then ask again "What is your name?" → AI doesn't remember.

  • On the AI ​​Agent node, click the + sign under Memory .
  • Choose Simple Memory (simple memory, stored in n8n – sufficient for basic chat).
  • By default, save the 5 most recent conversations → OK for testing.
  • Try again: Say the name → ask the name → the AI ​​remembers it!

9. Save workflow

  • Click the Save button in the upper right corner.
  • The workflow is saved, so you can reopen the chat later to continue or add features.

You've completed your first AI chat assistant with n8n! You've learned: the basic AI building blocks, adding an AI agent and chat model , tweaking the system prompt to change your reply style, and adding memory to retain conversation context.

Conclude

n8n is more than just an automation tool – it's an AI-powered platform that saves you time and increases your productivity. With its free self-hosted capabilities and powerful AI agent integration, n8n is gradually replacing Zapier/Make for Vietnamese users. Try installing it today and start building your first workflow.

Close
Category

System

Windows XP

Windows Server 2012

Windows 8

Windows 7

Windows 10

Wifi tips

Virus Removal - Spyware

Speed ​​up the computer

Server

Security solution

Mail Server

LAN - WAN

Ghost - Install Win

Fix computer error

Configure Router Switch

Computer wallpaper

Computer security

Mac OS X

Mac OS System software

Mac OS Security

Mac OS Office application

Mac OS Email Management

Mac OS Data - File

Mac hardware

Hardware

USB - Flash Drive

Speaker headset

Printer

PC hardware

Network equipment

Laptop hardware

Computer components

Advice Computer

Game

PC game

Online game

Mobile Game

Pokemon GO

information

Technology story

Technology comments

Quiz technology

New technology

British talent technology

Attack the network

Artificial intelligence

Technology

Smart watches

Raspberry Pi

Linux

Camera

Basic knowledge

Banking services

SEO tips

Science

Strange story

Space Science

Scientific invention

Science Story

Science photo

Science and technology

Medicine

Health Care

Fun science

Environment

Discover science

Discover nature

Archeology

Life

Travel Experience

Tips

Raise up child

Make up

Life skills

Home Care

Entertainment

DIY Handmade

Cuisine

Christmas

Application

Web Email

Website - Blog

Web browser

Support Download - Upload

Software conversion

Social Network

Simulator software

Online payment

Office information

Music Software

Map and Positioning

Installation - Uninstall

Graphic design

Free - Discount

Email reader

Edit video

Edit photo

Compress and Decompress

Chat, Text, Call

Archive - Share

Electric

Water heater

Washing machine

Television

Machine tool

Fridge

Fans

Air conditioning

Program

Unix and Linux

SQL Server

SQL

Python

Programming C

PHP

NodeJS

MongoDB

jQuery

JavaScript

HTTP

HTML

Git

Database

Data structure and algorithm

CSS and CSS3

C ++

C #

AngularJS

Mobile

Wallpapers and Ringtones

Tricks application

Take and process photos

Storage - Sync

Security and Virus Removal

Personalized

Online Social Network

Map

Manage and edit Video

Data

Chat - Call - Text

Browser and Add-on

Basic setup