Every week someone asks me some version of this: "can I build this agent in n8n, or does it need to be coded?". It is a good question, and the honest answer is not the one that sells courses on either side of the n8n vs AI agentsProgram that uses a language model to choose actions, call tools and repeat the loop until a task is done, with little human input. in code debate.
I code my agents. The automations in the systems I maintain run inside the app itself, in a worker, with tests and deploys going through the same pipeline as the rest of the code. But that is the right choice for my case, not a rule. I will show you where each path shines and where each one sends you the bill.
First: What Is a Workflow and What Is an Agent
Anthropic drew a clean line between the two in a piece that became a reference (Building effective agents):
- Workflow: the AI model and the tools follow a path defined in advance. First do A, then B, and if X happens go to C.
- Agent: the model itself decides the path, picks which tool to use and when to stop.

The same piece gives the most useful advice in this whole conversation: start with the simplest possible solution and only add complexity when you need it. A good chunk of what the market calls an "agent" is really a workflow with an AI step in the middle. And that is fine. A workflow is more predictable, cheaper and easier to fix.
The "Boxes": N8n, Make, Zapier and Friends
These are the tools where you build the logic by dragging blocks around and connecting them with arrows: an email comes in, the AI classifies it, if it is a quote request it creates a card, if it is a complaint it sends a WhatsApp alert.
n8n is the most talked about today, with more than 209k stars on GitHub, and for good reason. It runs in the cloud or on your own server, has hundreds of ready-made integrations and an AI agent node built on top of LangChain, with pluggable model, tools and memory (n8n documentation).
Where it shines:
- Speed. An idea becomes a working workflow in an afternoon. For checking whether an automation makes sense at all, few things beat that.
- Non-developers can read it. The process owner looks at the screen and understands what is going on. That is gold in a small operation.
- Ready-made integrations. Spreadsheets, CRM, email, WhatsApp: almost everything is there.
Where it sends you the bill:
- Versioning. Connecting a workflow to a Git repository, with separate test and production environments, is a Business and Enterprise feature (source control documentation). On the smaller plans, "who changed what and when" becomes a real problem once the workflow grows.
- Testing. There are evaluations for AI workflows, which run a set of examples and compare the results (Evaluations). But there is no automated testing of each piece like a codebase has.
- License. n8n is not open source in the strict sense. Its license, the Sustainable Use License, lets you use it in your own business and build automations for clients, but it does not let you sell a product where the customer builds their own workflows, even if n8n is hidden behind it (license FAQ). If the plan is to become a SaaS, this has to be on the table from day one.
- Giant workflows. With forty blocks and ten conditions, the screen that used to be clear turns into a plate of spaghetti. The "you can see everything" advantage disappears.
A cost detail few people compare: n8n cloud charges per execution of the whole workflow, no matter how many steps it has. Make charges per credit, usually one per module action, and Zapier per task, each successful action (Make, Zapier). On a long workflow, that difference adds up.
Agents in Code: CrewAI, LangGraph and the SDKs
On the other side are the frameworks where you write the agent as software:
| Tool | What it is, in one line | GitHub stars |
|---|---|---|
| CrewAI | Teams of agents with a role, a goal and tools, plus stateful flows | about 60k |
| LangGraph | Low-level orchestration for long-running, stateful agents | about 44k |
| OpenAI Agents SDK | A lean package: agents, handoffs between them and guardrails | about 30k |
| Claude Agent SDK | The Claude Code engine as a library, in Python and TypeScript | about 8k |

Star counts checked on November 1, 2026. Stars measure interest, not quality.
Where they shine:
- Everything is code. It goes into Git, gets reviewed, has tests and ships through the same pipeline as the rest of the system. When something breaks at three in the morning, you can tell exactly what changed.
- Fine-grained control. A spending cap per run, retries only on certain errors, which tools the agent can call and with which permissions.
- It becomes a product. No license restriction on selling it, and the agent lives right next to the database, the authentication and the business rules.
Where they send you the bill:
- You need someone who codes, today and a year from now.
- Slower to start. What takes an afternoon in n8n can take a few days, because you are also building the structure around it.
- The infrastructure is yours. Queues, logs, token cost monitoring. Tools like LangSmith or Langfuse help you see what the agent did, but someone has to turn them on and actually look.
The Decision Map
Put together the two questions that weigh the most, who maintains it and who decides the path, and each tool lands in its own square:
Notice that n8n shows up in two squares: Visual workflow and Visual agent. It does both. The question is not "n8n or code", it is "who is going to look after this, and how much does a mistake cost".
Answer Three Questions
Before you choose, answer honestly:
- Is the path always the same? If yes, start with a workflow. If every case calls for different judgment, that is where an agent comes in.
- Who will maintain this six months from now? If it is someone from operations who does not code, the visual tool protects the company from depending on a developer. If there is a technical team, code is cheaper in the long run.
- How much does a mistake cost? A welcome email that goes out wrong is annoying. An agent that approves payments, answers customers or touches personal data needs tests, an audit trail and review. The more expensive the mistake, the more code pays for itself.
The Project Stage Changes the Answer
The same process can go through both worlds:
- Idea. Build it in n8n, or even by hand. The goal is to find out whether the automation solves the problem, not to make it pretty.
- Real use, few cases. The visual workflow holds up fine. Document what each block does, because this is where the spaghetti is born.
- It became part of the business. Time to ask whether it would be better to rewrite it in code. Clear signs: nobody understands the whole workflow anymore, a mistake has already cost money, or it needs to talk to your main system all the time.
- Scale. n8n scales, with queue mode, Redis, separate workers and Postgres (queue mode). It works, but by then you are already running infrastructure, and the "no code" advantage has shrunk a lot.
Whatever the path, writing down beforehand what the agent should do, which cases it handles and what counts as success saves more rework than any tool. A half-page spec settles half of the "that is not what I meant" discussions.
Both Together
The combination I see work best: the agent in code talks, interprets and decides; the visual workflow runs the repetitive tasks that operations wants to be able to tweak on their own, triggered by a webhookHTTP call a system makes to your address when something happens, like an approved payment, notifying you right away instead of you polling for changes.. Each side does what it does best.
So, Is N8n a Good Choice?
Yes, it is. For validating an idea, for a small operation and for a predictable workflow maintained by people who do not code, it is one of the best options out there today. Just do not treat it as the answer to everything: when the process becomes a product, needs tests and touches expensive things, code costs less in the long run.
In my day to day, the automations in the AYA Energia Portal, like the daily collection of generation data from the solar plants, run in a worker inside the system itself, because they need tests, history and to talk to the database every minute. If a client asks me for something to validate in a week, that is a different conversation.
If you are stuck on this choice with a real process, I can help you decide before you build: AI automation, AI agents for businesses and process automation.
Frequently Asked Questions
n8n vs AI agents in code: which is better if you do not code?
n8n, or another visual tool. You can go a long way without writing code. Just agree with someone technical on the risky parts, like permissions and personal data.
Can I use n8n to sell a product?
It depends on the product. Building and maintaining automations for a client on your own instance is allowed. Offering a platform where the customer builds their own workflows is not, under the current license. Read the license FAQ before you decide.
Does CrewAI replace n8n?
No. They solve different problems. CrewAI is for people who code and want agents with roles and fine-grained control. n8n is for building workflows and integrations fast. Plenty of projects use both.
Is it worth migrating an n8n workflow to code?
When it becomes a critical piece of the business, nobody understands the whole design anymore or a mistake has already cost a lot. Before that, probably not.
References
- Anthropic. Building effective agents, Dec. 2024.
- n8n. AI nodes and LangChain, source control, evaluations, queue mode, license FAQ and pricing.
- CrewAI. Introduction.
- LangChain. LangGraph overview.
- OpenAI. Agents SDK.
- Anthropic. Claude Agent SDK.
- OWASP. LLM01:2025 Prompt Injection.
- Renato Asse, ibe.IA. CrewAI vs n8n (in Portuguese).
- Halk. Agentes de IA vs automação de workflows (in Portuguese).
- Bruno Silva, DIO. Agentes de IA: transformando a automação com CrewAI e n8n (in Portuguese).