Published on

n8n: AI workflow automation you can host yourself

Blog
  • Photo of Henrico Piubello
    Henrico Piubello
    Henrico Piubello
    IT Specialist - Grupo Voitto

    IT Specialist - Grupo Voitto

n8n is an automation platform where you wire triggers, APIs, databases and AI models onto a canvas — and write code when the canvas is not enough. What sets it apart in the market is the ability to run on your own infrastructure, without sending data to third parties.

What is n8n and why did it gain ground?

n8n is a workflow automation tool founded in 2019 by Jan Oberhauser in Berlin. The model is the same as Zapier and Make: a trigger fires, data flows through a sequence of nodes, each node does one thing. The difference lies in three design decisions.

The first is self-hosting. You run the platform in a container on your own infrastructure and the data never leaves it. For companies handling personal data under privacy regulations such as Brazil's LGPD or sensitive information, that stops being a preference and becomes a requirement.

The second is first-class code. Any node can contain JavaScript or Python. There is no ceiling of the kind pure visual tools impose: when the ready-made connector does not do what you need, a code node does.

The third is the billing model. Zapier and Make count tasks or operations — every step of the flow consumes quota. n8n counts workflow executions: a workflow with forty nodes costs the same as one with two. At volume, the difference is an order of magnitude.

Practical example: a flow that reads 500 emails a day, extracts attachments, calls an API and writes to a database consumes 2,000 daily tasks on a tool that charges per step. On n8n, that is 500 executions — and, self-hosted, the cost is the machine.

How does a workflow work in practice?

Every flow has the same anatomy: a trigger and a chain of nodes.

The most used triggers are:

  • Webhook — the platform exposes a URL; whoever calls it fires the flow. It is the integration trigger par excellence (see the webhook concept).
  • Schedule — cron-based execution, for daily routines or minute-by-minute checks.
  • Application trigger — an event in an external service: a Slack message, a new spreadsheet row, a GitHub issue.
  • Manual — for testing and for flows triggered on demand.

The following nodes fall into four families: action (call an API, write to a database), transformation (rename fields, aggregate, split lists), flow control (conditional, loop, wait, merge) and code (JavaScript or Python when nothing prebuilt fits).

code-node.js
// "Code" node: normalizes an API response before writing to the database
return items.map((item) => {
  const p = item.json;
  return {
    json: {
      order: p.order_number,
      customer: p.customer?.name?.trim() ?? 'Not provided',
      total: Number(p.total_amount ?? 0),
      createdAt: new Date(p.created_at).toISOString(),
    },
  };
});

The detail separating a toy flow from a reliable one is error handling. Every node has retry and on-failure settings, and each workflow can have a dedicated error flow that logs the problem and notifies. Without that, an unstable API makes the flow fail silently — and you find out from the customer.

Practical example: an inventory sync flow started failing when the supplier began returning 429 at peak hours. The fix was configuring three retries with increasing backoff and an error flow that opens a ticket after the third — a two-minute change that eliminated a recurring incident.

n8n, Zapier or Make: which should you choose?

The three serve different audiences, and choosing by hype is the fastest way to regret it:

Criterionn8nZapierMake
Self-hostingYesNoNo
BillingPer workflow executionPer task (step)Per operation
Embedded codeJavaScript and PythonLimitedLimited
Integration catalogBroadThe largest on the marketBroad
Learning curveMedium, needs technical baseLowMedium
AI and agent featuresNative and extensivePresentPresent
Best forTechnical teams, sensitive data, high volumeBusiness teams, quick integrationsComplex visual flows

The rule of thumb: if nobody on the team is technical, Zapier delivers value faster. If there are data restrictions, high volume or a need for logic that departs from the standard, n8n repays the additional effort of maintaining the infrastructure.

Practical example: an agency with ten clients and simple flows is still better served by Zapier. A healthcare company that cannot send patient data outside its own environment has no choice: it needs self-hosting.

How does n8n connect with AI and agents?

This is the point that changed the tool's relevance over the past two years. Beyond nodes that call language models for one-off tasks — classify, summarize, extract — the platform offers an agent node with the pieces that would normally require code:

  1. Model — the provider and model the agent uses to decide.
  2. Tools — other nodes or entire flows exposed as capabilities the agent can call.
  3. Memory — conversation history persisted between executions.
  4. Vector database — for RAG, enabling answers grounded in your own documents.

The practical effect is drastically shortening the path from idea to a working prototype of an AI agent. Assembling the loop, connecting tools and testing takes an afternoon, not a sprint.

Two honest caveats. First: the ease hides the same structural limitations agents have — error that compounds with each step, variable cost per run and vulnerability to instructions embedded in external data. A visual interface solves none of that. Second: for complex agents with fine-grained context control and elaborate decision logic, writing code gives more control. n8n shines in the middle band: automations with a touch of intelligence, not sophisticated agentic systems.

Practical example: a ticket triage flow receives the email via webhook, the model classifies it into one of six categories, a conditional routes it to the right queue and ambiguous cases go to human review. Simple, verifiable and immediately valuable — the profile of case where this combination works best.

What are the risks of over-automating with a visual tool?

Four traps appear in almost every adoption that matures:

  1. Flows become critical systems with no owner. What started as one person's convenience ends up sustaining a billing process. Treat production flows like software: a defined owner, documentation and review.
  2. No versioning and no environments. Editing directly in the production flow is the equivalent of editing code on the server. Export flows as JSON into Git and keep separate instances for test and production.
  3. Scattered credentials. Each node stores a credential and, without discipline, admin tokens end up used where read access would suffice. The same least-privilege principle from any integration applies.
  4. Complexity hidden in the canvas. A flow with ninety nodes and seven branches is unreadable — and no diagram changes that. When a flow reaches that point, the right answer is usually to extract the logic into a service with tests and leave n8n orchestrating.

The counterpoint matters just as much: for the vast set of small automations that would never become software projects — the ones done by hand today, or simply not done — the platform delivers real and immediate value. It is the same reasoning that applies to chatbot and automation tools: the right tool is the one that matches the size of the problem.

Practical example: a financial reconciliation flow grew for two years until it had 120 nodes and nobody who could explain it end to end. The rewrite as a service took three weeks — and n8n stayed in the role it does well: scheduling, calling the service and notifying the result.

How do you get started with n8n safely?

A roadmap that avoids the most expensive mistakes:

  1. Bring it up with Docker. A docker compose with n8n and a Postgres for persistence handles installation. The official image plus a data volume is enough to start — worth reviewing the fundamentals in the Docker guide.
  2. Automate a task you already do by hand. A weekly report, an error alert, a sync between two spreadsheets. A known problem with a verifiable result.
  3. Configure errors and retries from the first flow. That is what separates reliable automation from a silent time bomb.
  4. Version the flows. Export the JSON and put it in Git. Without that, there is no history and no rollback.
  5. Only then add AI. With the flow stable and monitored, inserting a classification node or an agent becomes an increment — and you can measure whether it improved the outcome.

Practical example: CodeCrush's own editorial pipeline follows that logic — a daily schedule, a content generation step with a language model and a commit to the repository, with a log of every run. It started with three nodes and grew only where the data showed it was worth it.

Conclusion

n8n occupies a specific and increasingly valuable position: visual automation for people with a technical base, with the option to run on your own infrastructure and write code when the prebuilt connector falls short. Self-hosting answers privacy requirements that cloud tools cannot meet, and billing per execution — rather than per step — changes the economics of long flows. The AI nodes shortened the path from idea to working agent, but they do not alter the reliability and cost limits agents have by nature. The real risk is not technical, it is organizational: flows that become critical systems with no owner, no versioning and no tests. Treat production as production — Git, separate environments, error handling and monitoring — and the tool gives back far more time than it consumes.

## faq

Frequently asked questions

What is n8n?

n8n is a workflow automation tool created in 2019 in Germany. You build flows by connecting nodes in a visual editor — a trigger starts it, the following nodes call APIs, transform data, invoke AI models and write to databases or systems. Unlike most competitors, it can be hosted on your own infrastructure.

Is n8n free?

The self-hosted version is free for internal use under the Sustainable Use License: you only pay for the infrastructure it runs on. The official cloud is a paid subscription, and enterprise features such as SSO, separate environments and audit logs require a commercial license even on a self-hosted install.

What is the difference between n8n, Zapier and Make?

Zapier has the largest integration catalog and the lowest friction for non-technical users, charging per executed task. Make offers a richer visual editor for branching flows. n8n is the option for technical teams: it allows code inside nodes, runs on your infrastructure and charges per workflow execution rather than per step — which completely changes the arithmetic at high volumes.

Can you build AI agents in n8n?

Yes. The platform has dedicated agent nodes, with connections to models from different providers, conversation memory, vector databases for RAG and the ability to expose other flows as tools the agent can call. It is the fastest way to go from zero to a working agent without writing the loop infrastructure.

Is n8n for production or only for prototypes?

It is for production, with engineering caveats. Versioned flows, separate test and production environments, explicit error handling and execution monitoring are mandatory — otherwise you have a critical system with no code review and no tests. The platform supports queue mode with Redis and distributed execution for larger volumes.

Do I need to know how to code to use n8n?

Not to get started: simple flows are built by dragging nodes. But the real payoff requires an understanding of HTTP, JSON, API authentication and a bit of JavaScript to transform data. It is a low-code tool for people with a technical foundation, not a no-code tool for beginners.

## continue lendo

Keep browsing

About the author

Photo of Henrico Piubello

Henrico Piubello

IT Specialist - Grupo Voitto · Grupo Voitto

See profile and all articles