Module 10 Lesson 5: n8n AI Agents
·Automation

Module 10 Lesson 5: n8n AI Agents

The autonomous assistant. Learn how to build 'Agents' that can decide which tools to use to solve a user's request, from searching the web to updating your CRM.

Module 10 Lesson 5: n8n AI Agents

Standard AI chains follow a fixed path. But what if a user's question is: "What is the weather in London right now?". A standard model doesn't know the answer. An AI Agent does, because it knows how to use Tools.

1. What is an Agent?

An agent is an AI that has a "Thought Loop":

  1. Goal: Answer the question.
  2. Thought: "I don't know the weather. I should use the 'Weather Tool'."
  3. Action: It calls the tool (n8n node).
  4. Observation: It reads the result.
  5. Thought: "The weather is 20°C. I can now answer the user."

2. The Tool Node

In n8n, you don't just "Connect" nodes to an agent. You give them as Tools.

  • You can turn almost any n8n workflow into a tool.
  • "Hey Agent, you have access to my Google Sheets and my Slack. Use them if you need to."

3. The Power of "Orchestrator"

You can define the agent's "Personality" (System Prompt):

  • "You are a Senior Project Manager. Your job is to read incoming requests and decide if they should go to the 'Creative Team' or the 'Tech Team'."

4. The Loop Limit (Safety)

If an agent gets confused, it might "Think" in a circle forever, burning your API credits.

  • n8n allows you to set a Max Iterations (e.g., 5).
  • If the agent doesn't solve it in 5 steps, it stops and asks for help.

Exercise: The Agent's Journey

  1. Open the "Agent" node in n8n.
  2. Connect a "Google Search" and a "Calculator" tool.
  3. Ask: "What is the capital of France and what is that number multiplied by 5?".
  4. Watch the execution log. Did the agent call the Search tool first and the Calculator second?
  5. Why would you give an agent access to your "Help Center" PDF (Review Lesson 3) as a tool?
  6. Research: What is an "AI Memory" node (Window vs. Buffer) in the context of a chat agent?

Summary

You have completed Module 10: AI and LLMs in n8n. You have evolved from building "If/Then" scripts to building "Thinking Entities." By combining the structure of n8n with the intelligence of LLM Agents, you have the tools to automate the most complex intellectual tasks in your company.

Next Module: Locking down the factory: Module 11: Security and User Management.

Subscribe to our newsletter

Get the latest posts delivered right to your inbox.

Subscribe on LinkedIn