Whether you build an AI agent in n8n or on the API depends on two things: how often the task changes, and who has to adjust it without you. In n8n the loop runs inside the AI Agent node and every step stays visible on the canvas. On the API you run that loop yourself, or Anthropic runs it.
This is for a founder or director with a task that is bigger than a chatbot and smaller than a product. Anthropic’s own definition is narrow: an agent is an application that completes a task by planning its own steps and calling tools that read files, run commands or edit code[1]. Those tools are a contract between your application and the model. You specify which operations exist and what shape their inputs and outputs take, and the model decides when and how to call them[2]. If you are still weighing an AI agent against a chatbot, settle that question first, because it changes the answer here.
Do you build the agent in n8n or on the API?
Neither answer follows from the tooling. It follows from the task. Build in n8n when the steps fit existing nodes and somebody on the team has to be able to change them next quarter. Build on the API when the agent has to plan freely, live inside your own product, or reach code that no node covers.
The criteria that actually decide, in the order they bite:
- Does the task fit fixed steps? A workflow in n8n is a set of connected nodes that automate a process[3], and the nodes are the components that fetch, send and process data, define flow logic and connect to external services[4]. A task that falls outside those components is not a configuration problem, it is a code problem.
- Who adjusts it in six months? On a canvas, a colleague can see what the agent did and change a prompt or swap a tool. In a repository, that person needs to read code.
- Where does it have to run? Inside your own product means the API. Inside your operations means a workflow, and that is ordinary workflow automation with a model in the middle.
- What does it need to touch? Anthropic names calling into existing systems, databases, internal APIs and filesystems, as exactly what tool use is for: the bridge between a request in plain language and the system that fulfils it[2]. Which systems, and with which permissions, is the subject of connecting AI to your own systems.
- Does it need a tool at all? When the model can answer from training alone, as in summarising, translating or general-knowledge questions, no tool round trip is needed[2]. That is not an agent.
Who runs the agent loop?
Four of the five options hand the loop to someone else. Anthropic lists four ways to build an agent and says they differ on three axes: who runs the agent, what comes built in, and how you reach it[1]. n8n is the fifth answer to the same question. The AI Agent node runs the loop inside your workflow, where you connect a chat model and one or more tools and the agent decides which tools to call to complete the task[5].
| Build form | Who runs the agent loop | Who can adjust it in six months | Where it runs out |
|---|---|---|---|
| AI Agent node in n8n | the node, inside your workflow; you connect a chat model and the tools[5] | anyone who can read the canvas, no programming needed | the task has to fit the nodes, and at least one tool sub-node is mandatory[5] |
| Agent SDK | a library you call, which runs the Claude Code binary in a process you operate[1] | whoever maintains that codebase | you operate the process, so you carry the runtime, the updates and the logging |
| Claude Code CLI | the terminal interface, built for interactive use and one-off tasks[1] | the person at the keyboard, or whoever wrote the scheduled command | not built to sit behind a product feature for end users |
| Client SDK | you do, in your own code; you write the tool loop yourself or let the beta tool runner drive it[1] | a developer, every time | everything the other forms include, from permissions to sessions, is yours to build |
| Managed Agents | Anthropic, as a hosted agent harness, with sessions in a managed cloud sandbox or a self-hosted sandbox on your infrastructure[1] | whoever configures it through the Claude API | the harness is the vendor’s, so its behaviour and its limits are too |
Columns one and two are documentation[1][5]. Columns three and four are WeAdapt’s weighing of the same facts, not a statement from either vendor.
What sits behind each row, in Anthropic’s words. The Agent SDK is a library that runs the Claude Code binary and gives you Claude Code’s capabilities: built-in tools, permissions, sessions and hooks[1]. It gives the same tools, agent loop and context management that power Claude Code, programmable in Python and TypeScript[1]. The same mechanics sit under Claude Code for business. The Client SDK is direct access to the Claude API from any of the client SDK languages, where you write the tool loop yourself or hand it to the beta tool runner[1]. One detail decides a lot of plumbing there: server tools run on Anthropic’s infrastructure and you see the results directly, while client tools are executed by your application[6]. And Managed Agents is a hosted agent harness that runs the agent loop, with sessions in an Anthropic-managed cloud sandbox or a self-hosted sandbox on your own infrastructure[1].
Weighing two of these against each other for a specific task is a short conversation, not a project. WeAdapt builds the AI agents and hands them over with the choice written down. Book a call if you want that decision on paper before anyone starts building.
What does an agent in n8n need at minimum?
A chat model and one tool. n8n’s documentation is flat about the second part: you must connect at least one tool sub-node to an AI Agent node[5]. That requirement is the sharpest line between an agent and a chatbot in any vendor’s documentation. Without a tool there is nothing to decide, only something to say.
Two more components come with any production workflow. Nodes are the building blocks that determine when the workflow runs and what it does with the data[4], and a trigger node is the one responsible for executing the workflow in response to certain conditions, which every production workflow needs at least one of[4]. So the minimum is four things: a trigger, a chat model, one tool, and the node that holds the loop.
Claude decides when to call a tool based on the request and the tool’s description[6], so each tool description is part of the design rather than documentation written afterwards.
What happens when the vendor deprecates a version?
Your agent keeps running and your tutorial stops being true. n8n deprecated the AI Agent node’s agent type setting from version 1.82.0; all AI Agent nodes now work as a Tools Agent, which was the recommended and most used setting[5]. Workflows and templates that use an older AI Agent node set to Tools Agent continue to work as expected[5]. The version of the node that still has the agent type setting, v1, will be removed from n8n 3.0[5].
Read that as two separate facts, because they land on different people. Anyone following a tutorial from last year is looking at a screen that no longer exists, and the first half hour goes into finding a dropdown that was removed. Anyone who built an agent two years ago has something that still works today and a node version with a removal date on it[5][5].
That is the real cost of an agent, and it is not the build. Somebody has to notice a deprecation note in release notes they do not read. The same pattern decides whether any automation survives its second year: who owns an automation after launch. On the API the shape is identical, with SDK changelogs instead of node versions.
When is a hosted agent the better choice?
When you want the loop to be someone else’s problem and the sandbox to be your decision. Managed Agents is a hosted agent harness that runs the agent loop, configured through the Claude API, with sessions in an Anthropic-managed cloud sandbox or a self-hosted sandbox on your own infrastructure[1]. That split is the useful part. The harness is managed, while the question of where the code actually executes stays open.
One rule belongs in the same paragraph, because it catches products rather than internal tools. Unless previously approved, Anthropic does not allow third party developers to offer claude.ai login or rate limits for their products, including agents built on the Claude Agent SDK, and points to API key authentication instead[1]. So an agent inside something you sell is an API-key build by default. That is what the documentation says; it is not legal advice.
The rule the tutorials skip: how often does the task change, and who adjusts it?
Every comparison on this subject splits the world into visual and code, and then argues about which is more serious. That split is wrong twice. It treats n8n as one thing and the API as one thing, when Anthropic’s own documentation already distinguishes four build forms that differ precisely on who runs the agent and what comes built in[1]. And it answers a question nobody has to live with. Nobody is stuck with a canvas. They are stuck with maintenance.
Two questions decide it, in this order:
- How often does the task change? A task that changes monthly needs to be editable by whoever notices the change. A task that has been stable for two years can afford a repository, a pull request and a deploy.
- Who has to be able to adjust it without you? Write down the name. If that person cannot read code, the loop belongs somewhere they can see it, which today means the AI Agent node[5]. If that person is a developer, the canvas is a constraint rather than a feature, because the task has to keep fitting the nodes[5].
Answer those two and the build form follows, with the tooling argument never coming up. The split misleads once more: it suggests that building on the API means building everything. Three of the four Anthropic forms hand you the agent loop already assembled[1]; only the Client SDK leaves it to you.
The honest version of the trade-off is this. In n8n you accept a ceiling on what the task can become, in exchange for a system your team can still change. On the API you accept a dependency on whoever maintains the code, in exchange for a task with no ceiling. Neither is safer in general; one is safer for your task, and the two questions above tell you which. Making that call with a second pair of eyes is what a short consultancy engagement is for.
Frequently asked questions
Can one agent run partly in n8n and partly on the API? Yes, and it is often the cheapest answer. The workflow keeps the trigger, the connections and the visible steps[4], and the part that needs free planning runs on the API. The AI Agent node still needs its own chat model and at least one tool sub-node to count as an agent[5].
Is an agent in n8n less capable than one on the API? It is differently bounded. The node runs the loop and the agent decides which of the connected tools to call[5], so within those tools it is a real agent. The ceiling is the set of nodes and tools you connected, not the model. On the API the ceiling is whatever you write.
What does Anthropic actually mean by a hosted agent? A harness that runs the agent loop for you. Managed Agents is configured through the Claude API and keeps sessions in an Anthropic-managed cloud sandbox, or in a self-hosted sandbox on your own infrastructure[1]. You configure behaviour and tools; the loop and the session management are the vendor’s.
Still weighing where an agent should live, and who in your team keeps it running afterwards? WeAdapt builds the agent, writes down which build form was chosen and why, and hands it over to the person who has to maintain it. Book a call to put that decision on paper first.