Tutorial: Create Your First Autonomous AI Agent with n8n (Complete Guide)
Go from theory to practice. This step-by-step guide shows you how to configure an AI agent in n8n capable of doing web research and writing summaries automatically.

William Aklamavo
November 15, 2025
Tutorial: Create Your First Autonomous AI Agent with n8n (Complete Guide 2025)
You've heard of AI agents and want to build your own? You are in the right place. With the recent updates to n8n in November 2025, creating an autonomous agent has become accessible to everyone, without needing to be a Python expert.
In this tutorial, we will build a "Tech Watch Agent". Its mission: Search for the latest news on a given topic, analyze it, and send us a concise summary on Slack or via Email.
Prerequisites
- An n8n account (Cloud or Self-hosted version 1.65+).
- An OpenAI API key (or Anthropic).
- (Optional) A Tavily or SerpApi API key for web search (Tavily offers a generous free version).
Step 1: Create the Workflow and Add the AI Agent Node
- Open your n8n editor and create a new workflow.
- Add a trigger node. For this test, use the "On Chat Heading" node (if you want to chat with it) or "Manual Trigger". Let's say "Manual Trigger" to start.
- Search for and add the "AI Agent" node.
This is the heart of our system. Double-click on it to configure it.
Step 2: Configure the Brain (The Model)
The agent needs a brain.
- In the AI Agent node inputs, you will see a connector for "Model".
- Add an "OpenAI Chat Model" node and connect it to the agent's "Model" input.
- Configure your OpenAI credentials.
- Select the model: GPT-4o or GPT-4o-mini (faster and cheaper, often sufficient).
Step 3: Give Tools to the Agent
This is where the magic happens. Without tools, AI can only talk. With tools, it can act.
- In the AI Agent node inputs, locate the "Tools" connector.
- We will add a search tool. Search for the "Tavily Search" node (or an "HTTP Request" tool configured for a search API if you prefer). Connect it to the "Tools" input.
- (Optional) Add a "Calculator" tool if you want it to be able to do math, or a "Wikipedia" tool.
Note: You can connect multiple tools to the same "Tools" connector. The agent will choose the one it needs.
Step 4: Define the System Prompt
Go back to the AI Agent node configuration. In the "System Message" or "Instructions" field, give it its personality and rules:
"You are an expert technology research assistant. Your goal is to find precise and recent information on the subject requested by the user. Use the search tool to find facts. Only cite verified information. At the end, write a structured summary in English with bullet points."
Step 5: Test the Agent
- Add an "Edit Fields" (Set) node before the agent to define your question (if you are not using the Chat Trigger). Create a field
chatInputwith the value: "What are the latest Next.js features released this week?". - Execute the workflow.
What will happen (watch the execution view):
- The agent receives the question.
- It "thinks" and sees that it doesn't know the answer by heart because it is recent.
- It decides to use the Tavily Search tool.
- It generates an optimized search query.
- Tavily returns the results.
- The agent reads the results, synthesizes them, and generates the final answer.
Step 6: Connect to Output (Slack/Email)
Once the agent has generated its response (output of the AI Agent node), you can add a "Slack" or "Gmail" node.
Use the agent's output variable (usually output) as the message content.
Conclusion and Going Further
Congratulations! You have just created an autonomous agent. It's not just a script that searches Google; it's an AI that understood your need and used a tool to answer it.
To go further:
- Add a Memory (Window Buffer Memory) to have a continuous conversation.
- Give it more powerful tools: access to your Notion, your Google Calendar, or the ability to send HTTP requests to your own APIs.
Automation with n8n is now limited only by your imagination.