How to Build Your First AI Agent in n8n, Step by Step

A first agent should be small. Here is a safe pattern: an assistant that answers questions from a price list.

Step 1: Define the job

Write one sentence: “Answer customer questions about product prices using our sheet, and say when unsure.”

Step 2: Add a trigger

Use the Chat Trigger to test in the editor. Later you can connect messaging apps.

Step 3: Add the AI Agent node

Connect a chat model through the model input. Set credentials for your chosen provider (see using AI models in n8n).

Step 4: Write a clear system prompt

State the role, the tone, what it may and may not do, and what to say when unsure.

Step 5: Give it one tool

Add a tool that reads your sheet (agent tools). Describe the tool clearly so the agent knows when to use it.

Step 6: Test with hard questions

Try missing items, odd spellings and off-topic questions. Check the execution log to see which tool the agent used.

Step 7: Add limits

Limit tools, set a maximum number of steps and keep a person in the loop for risky actions.

Next

Add memory and cost control.

Quick answers

Which nodes do I need?

A trigger, the AI Agent node, a chat model and one or more tools.

How do I test an agent?

Ask hard and off-topic questions and read the execution log.

Can it run without a paid model?

You need a model provider; some offer free or low-cost tiers.


Related reading

Want to learn n8n with a trainer, not just videos?

Our 15-day live n8n course takes you from the editor basics to APIs, messaging, AI agents and a final project, in Hindi and English. Fees start at ₹4,999 (final pricing may vary by format).

See the 15-day n8n training  |  Find your city  |  Book free counselling

Want to learn n8n hands-on?

Join our 15-day live, trainer-led n8n training.

Book Free Counselling
WhatsApp Call Enquiry

Request A Callback

Talk To Our Expert

We use your details only to contact you about this training.