- An n8n AI agent is a workflow built around the AI Agent node: a model, tools, memory.
- It can “succeed” while looping, answering with nothing or costing three times more.
- Four signals to track: failure, silence, duration, cost.
- Set an iteration limit and an error workflow from day one.
An n8n AI agent is a workflow whose core is the AI Agent node: you attach a language model, tools (HTTP request, database, another workflow) and optionally a memory. On every execution, the model decides which tools to call and how many times. That is what makes it useful, and also what makes it hard to monitor.
Building an AI agent in n8n: the essentials
- A trigger: chat message, webhook, incoming email or schedule.
- The AI Agent node with its system prompt: role, limits, answer format.
- A model attached as a sub-node, with its API key.
- Tools described precisely: the model chooses by reading their description.
- A memory if the agent has to follow a conversation.
What breaks in production
- The loop. The agent calls the same tool again and again until it hits the limit and stops with “Agent stopped due to max iterations”.
- The model provider. Quota exceeded, rate limit, retired model: the execution fails, or the agent answers with nothing.
- Cost. A growing memory or a longer prompt multiplies token usage without any error.
- Slowness. More tool calls mean more seconds. The user does not wait.
- Silence. The trigger receives nothing: no execution, no alert. It is a silent failure.
Settings to make before going live
- A low iteration limit on the AI Agent node, raised only if needed.
- An error workflow attached to the agent.
- A spending cap with the model provider.
- An API key dedicated to this agent, to isolate its consumption.
The four signals to monitor
| Signal | What it reveals |
|---|---|
| Failure | Unavailable model, failing tool, iteration limit |
| Silence | Broken trigger, deactivated agent, stopped instance |
| Duration | Tool loops, slow model |
| Cost | Growing prompt or memory, model change |
Nokto tracks these signals for each agent, without adding anything to the workflow and without reading the exchanges. See AI agent monitoring.
Frequently asked questions
What does “Agent stopped due to max iterations” mean in n8n?
The agent reached the maximum number of turns allowed without producing a final answer. It is usually a loop on a tool that is poorly described or returns an error.
Can an n8n AI agent run unattended?
Technically yes. But it is the kind of workflow whose cost and behaviour vary most from one execution to the next: it is the one to monitor first.