Get your API key

Lesson 1 of 5

Your first AI agent in n8n

Chain vs agent, the four parts of an agent, a system message written like a job description, and a first test in the n8n chat.

8 min Free
One step at a time, like flipping pages.

By the end of this lesson you will have an AI Agent in n8n that chats with you, follows a written job description, and decides on its own when to use a tool.

You need: n8n with the AllModelAPI OpenAI credential from AI inside n8n · Time: 8 minutes

  1. In AI inside n8n you used a Basic LLM Chain: one prompt goes in, one answer comes out, the same path every time. That is perfect for sorting form messages into categories.

    An AI agent is different. You give it a goal and some tools (nodes it is allowed to use, like "read the orders sheet"). For each message, the agent decides whether it needs a tool, calls it, reads the result, and repeats until it can answer.

    Our example for this whole course: Shree Sarees, a small boutique in Surat that sells on Instagram and ships across India. Every day customers write "Where is my order SS-1042?" or "Is the maroon Banarasi back in stock?". The owner wants an assistant that can look these up and draft replies, but never send anything without a check.

    Why?

    Agents cost more than chains: one question can mean three or four model calls. Use a chain when the steps are always the same, and an agent only when the AI must choose what to look up.

    Match them

    Match each job with the right n8n node

    Tap an item on the left, then its meaning on the right.