N8n: An Evolved Flowchart?
N8n reminds me of flowcharts. Boxes, arrows, conditions… the logic is identical. The only things layered on top are triggers — you attach triggers to buttons and write code inside functions to run them.
Between you and me, this reminded me of my university Algorithms class. Hats off to Professor Mustafa — and I’m not exaggerating here: he had us write out a 150-sentence “tea brewing algorithm” longhand in our notebooks. I can still picture it. My hand was about to fall off.
Brewing tea is trivial in practice. In theory, it's a different story:
- Is there tea in the house? If not, borrow some from the neighbour.
- Is the neighbour home? If not, ask the other neighbour.
- Is the water running? If it's cut off, get water from the neighbour. (Is the neighbour home? Go back to the start.)
- Is the gas cylinder full? If it's empty, call the supplier.
- Is the supplier open? If closed, wait until tomorrow.
- Is the teapot clean? If not, wash it. If the water is cut off, find water.
And so on.
Time for the water to boil: 5–10 minutes. Time to write these steps down in a notebook: two class periods.
There were variations on every branch. We wrote 150 sentences like this; the algorithm never ended, and in theory the damned tea still hadn't brewed. In practice, tea takes 5–10 minutes once the water boils. In theory, it's a never-ending saga. The tea-brewing algorithm is at its best as a diagram.
What Is n8n?
n8n is a node-based platform that lets you build workflow automation through a visual editor. The name is short for "nodemation"; it's pronounced "n-eight-n."
The short definition: an event fires → data flows between nodes → each node either transforms the data or performs an action on an external system.
What stands out:
- Node-based visual editor — drag and drop, but behind the scenes every flow is just JSON.
- Both no-code and low-code — when the built-in nodes aren't enough, you can write JavaScript (or Python) in a Code node. This is the single most important thing separating n8n from pure no-code tools.
- 400+ built-in integrations — Slack, Google Workspace, Postgres, HTTP Request, Telegram, Jira…
- Native AI support — the AI Agent node, LangChain nodes, vector stores, memory and tool connectors are all baked into the platform.
- Self-hostable — you can run it on your own server with Docker; your data stays on your own infrastructure.
2. n8n Architecture
2.1. Logical Architecture — Workflow / Node / Execution
Workflow: an entire business flow. Physically, it's a JSON file: a list of nodes, the connections between them, and settings. That's why export/import works with a single file, and why workflows can go into version control.
Node: the building block of a flow. There are three main types:
- Trigger node — the node that starts the flow. Every workflow has exactly one starting point (Manual, Schedule/Cron, Webhook, Chat, or app-specific triggers).
- Regular node — a node that transforms data or makes a request to an external system (HTTP Request, Postgres, Set, IF, Merge, Code…).
- Sub-node / tool node — nodes that don't stand alone in the flow but attach to a parent node. The AI Agent's Chat Model, Memory and Tool connectors are examples. An asterisk (*) next to a connector means that connection is required.
The data model — this is the most critical part. What flows between nodes in n8n is not a single object but an array of items. Roughly:
[
{ "json": { "name": "Ozcan", "topic": "Kafka" }, "binary": {} },
{ "json": { "name": "Ahmet", "topic": "K8s" }, "binary": {} }
]If a node receives 10 items, its default behaviour is to run once per item and produce 10 results. When this "item-based execution" model isn't understood, flows behave unexpectedly — this is where beginners get stuck most often in n8n.
Nodes access each other's output through expressions:
{{ $json.name }}
{{ $node["Chat Trigger"].json.chatInput }}2.2. Runtime Architecture — From a Single Process to a Distributed Setup
n8n is written in TypeScript and runs on Node.js. The frontend is a Vue-based editor. The persistence layer is a relational database: SQLite by default, with PostgreSQL recommended for production. Workflow definitions, credentials and execution logs all live there — the database is the single source of truth.
Credentials are written to the database encrypted; the encryption key comes from the N8N_ENCRYPTION_KEY environment variable. If you lose that key, none of your stored credentials can be decrypted — it's the first thing you should back up.
From here, things split in two depending on the execution model.
A) Regular mode (single process)
The default mode. A single Node.js process does everything: serves the editor UI, handles API requests, manages triggers and schedulers, and executes the workflows itself.
┌─────────────────────────────────────┐
│ n8n main process │
│ UI + API + Trigger + Execution │
└──────────────────┬──────────────────┘
│
┌──────▼──────┐
│ SQLite/PG │
└─────────────┘Fine for small volumes. But a single long-running workflow will slow down the editor and the other triggers too, since it runs in the same process — the classic single-process bottleneck.
B) Queue mode (production architecture)
This is the recommended architecture for production. Responsibilities are separated:
┌──────────────────────┐
│ n8n Main │
│ UI + API + Trigger │
└──────────┬───────────┘
│ execution ID push
┌──────────▼───────────┐
│ Redis │ ← Bull-based job queue
│ (message broker) │
└──────────┬───────────┘
│ workers pull
┌─────────────┼─────────────┐
┌────▼────┐ ┌────▼────┐ ┌────▼────┐
│ Worker1 │ │ Worker2 │ │ WorkerN │
└────┬────┘ └────┬────┘ └────┬────┘
└─────────────┼─────────────┘
┌─────▼─────┐
│ PostgreSQL│
└───────────┘Here's how it works:
- The main instance handles timers and incoming webhook calls, creates an execution — but doesn't run it.
- It pushes the execution ID to Redis; Redis holds the queue of pending executions (using Bull under the hood).
- An available worker from the pool picks up the message, pulls the workflow definition from the database using the execution ID, and runs the flow.
- When the worker finishes, it writes the result to the database and sends a "done" message to Redis; Redis notifies the main instance.
There's also an optional extra layer: the webhook processor. You can run separate processes to handle incoming webhook traffic and put a load balancer in front of them, which significantly increases parallel request capacity. n8n recommends not putting the main process into the load balancer pool.
There's also the concept of task runners: a mechanism for offloading user-supplied code (like the Code node) to separate runners isolated from the worker process — for security and resource isolation.
Scaling in practice
Daily executions Recommended setup < 1,000 Regular mode + PostgreSQL is enough 1,000–10,000 Queue mode + 1 worker > 10,000 More workers + a separate webhook processor
On the resource side, each worker is reported to consume roughly 200–500 MB of RAM, and 2 vCPU / 4 GB is a reasonable starting point for small installations. Trying to run ten workers on a 4 GB VPS ends in an OOM kill.
This architecture maps neatly onto Kubernetes: main as one Deployment, workers as a separate Deployment whose replica count you can scale, with Redis and Postgres as separate services. You can autoscale with an HPA based on queue depth.
Running It for Free: Docker Desktop
There are two ways to use n8n: self-hosting it on your own server with Docker, or using n8n's own cloud.
On the cloud there's a minimum plan of 20 EUR per month with a 2,500-execution limit. The Business plan comes with a 40,000 workflow execution limit.
You can sign up on the official n8n.io site with your email address and get a 14-day trial; after that you have to move to a paid Pro plan.
The alternative is a self-hosted installation: run a container via Docker Desktop and use n8n as much as you want, for free. "Start it when you need it, shut it down when you're done." You can create unlimited workflows.
Thanks to Docker volumes, your workflows and credentials stay on disk even when the container is shut down; restart the container and you pick up where you left off. Even so, I'd recommend exporting your critical flows as JSON from the n8n interface (Export) and backing them up.
Getting n8n Up and Running on Docker Desktop
Installation
Once Docker Desktop is installed, you just need to run these commands in your terminal, in order.
- Create the volume:
docker volume create n8n_data- Run the container (change the timezone value to your own region):
docker run -it --rm \
--name n8n \
-p 5678:5678 \
-e GENERIC_TIMEZONE="<YOUR_TIMEZONE>" \
-e TZ="<YOUR_TIMEZONE>" \
-e N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true \
-e N8N_RUNNERS_ENABLED=true \
-v n8n_data:/home/node/.n8n \
docker.n8n.io/n8nio/n8nHere's the same thing as a single line, set to the Istanbul timezone — you can copy and run it as is:
docker run -it --rm --name n8n -p 5678:5678 -e GENERIC_TIMEZONE="Europe/Istanbul" -e TZ="Europe/Istanbul" -e N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true -e N8N_RUNNERS_ENABLED=true -v n8n_data:/home/node/.n8n docker.n8n.io/n8nio/n8nYou can check the official documentation here: https://docs.n8n.io/deploy/host-n8n/install-options/install-with-docker
Once the command runs, you'll see the output "Editor is now accessible via http://localhost:5678". From there you can build workflows without limits and without an execution cap.
Get Özcan Kara’s stories in your inbox
Join Medium for free to get updates from this writer.
n8n is now running on localhost. Log in and start exploring.
Concepts You'll Meet After Logging Into n8n
Triggers
When you click Add first step on an empty canvas, n8n asks you a single question: "What triggers this workflow?" In other words, what will start this flow? Because before a workflow can run, it needs an event to set it off.
There are four basic trigger types:
- Trigger manually — the flow doesn't run on its own; you start it by pressing a button in the n8n interface. Mostly useful while learning and testing; rarely used in real production flows.
- On a schedule — the flow runs by itself at a time you set. For example, it fires every morning at 10:00, goes to the orders table, runs your SQL scripts, produces an analysis from the returned data, and emails the result to management. A report prepared while you sleep.
- On webhook call — with this option you're effectively creating an API endpoint on n8n. You can build operational processes triggered externally via GET, POST, PUT, DELETE requests.
- On chat message — used for flows driven through conversation, i.e. chatbot scenarios.
Integrations and Node Logic
n8n has more than 300 built-in integrations. If you're building a Telegram bot, the Telegram node is already there; if you're writing to a spreadsheet, so is the Google Sheets node — no need to write client code from scratch.
Every construct on the platform is a node. You drag and drop nodes, connect them to each other, and set up the data flow between them. The first node is always a trigger; everything after that is up to your design.
A First Simple Project — Workflow: Chatbot + AI Agent
In the flow on screen there's really only one true trigger; everything else is attached to it. In order:
I worked through this on the free trial — n8n gives you 100 free credits so you can use OpenAI models.
1. Chatbot (the box on the left with the lightning icon)
This is the only trigger. In n8n, the lightning icon means "this node starts the flow." The Chat Trigger runs when someone types a message into the chat window and fires the flow. The chatInput field you see in the output is exactly that — the text the user typed. The sessionId (bdf266d9be…) is the identifier that uniquely identifies the conversation; stay in the same chat and the ID stays the same, open a new chat and it changes.
Adding the chat trigger
Add first step → scroll down and select "On chat message." If the node doesn't appear in the list, type "chat" into the "Search nodes" box and pick "On new chat event."
After adding the node you can talk to the bot with "Open chat." Type "hi" and you get back a meaningless-looking JSON output — fields like action, sendMessage, chatInput, showing your text exactly as you typed it.
Naming
Node names can be changed: click the node and press the space bar, or right-click → Rename. You could name it "Chatbot."
Naming isn't mandatory — n8n won't stop you — but it helps enormously in understanding which node does what in the flow.
The "My Workflow" label in the top left can be changed too; I named mine "Basic Chatbot."
2. AI Agent
Not a trigger — this is the node that does the work. It takes the incoming message, decides what to do, and produces the answer. The three connection points underneath it are its "capabilities":
Adding the AI Agent
Click the + icon on the right side of the node and n8n offers suggestions for the next step. Select AI → AI Agent.
The important thing here is to pick the AI Agent rather than a direct model node like Anthropic or Google, if you want to build a real agent
- Chat Model → OpenAI Chat Model: the agent's brain. This is where you choose which model it will query. The asterisk (*) means this connection is required — an agent without a model won't run. You can activate the "Claimed 100 free OpenAI API credits!" offer here.
- Memory → Simple Memory: holds the conversation history. It works off the
sessionId; without it, the bot acts like it's meeting you for the first time on every message. "2 items total" means two messages have accumulated in memory so far.
- Besides Simple Memory, the Memory section also offers Redis, Postgres, MongoDB and Xata. If you want persistent memory, you can connect one of these with your own API key and credentials.
- Tool (currently empty): the agent's hand reaching out into the world. This is where you attach tools like HTTP requests, database queries, or sending a Telegram message. Right now it's empty — meaning the agent only talks, it doesn't do anything.
In the output, action: sendMessage is the event type produced by the Chat Trigger — the "the user sent a message" signal.
What Is an "Execution"?
One end-to-end run of a workflow you've built. You could think of an execution as a successful test run.
Example: you built a Telegram bot, the user typed "weather Istanbul," the bot fetched the Istanbul weather, had the AI analyse it, and sent the result back as a message. That whole process, from start to finish, counts as 1 execution.
3. n8n's Advantages
3.1. Self-hosting and data sovereignty
This is the biggest difference. Zapier and Make are fully SaaS; your data has to pass through their infrastructure. You can run n8n on your own VPS, in your own VPC, even in an air-gapped environment. For teams under KVKK/GDPR constraints, or working with financial or health data, this usually isn't even negotiable.
3.2. Cost model: per infrastructure, not per execution
The SaaS competitors charge per task/operation — a 10-step flow eats 10 tasks in a single run. With self-hosted n8n, your limit is the capacity of the server you're renting. For high-volume automation the difference is multiples.
3.3. You don't get stuck between no-code and code
The classic wall with pure no-code tools: the moment you need something the tool's designers didn't think of, you're blocked. In n8n you can get past that step by writing JavaScript in a Code node. 90% of the flow is visual, the critical 10% is code — this hybrid model extends the tool's useful life considerably.
3.4. AI agents are first-class citizens
The AI Agent node, LangChain integrations, vector stores, memory backends (Simple Memory, Redis, Postgres) and the tool connector are all built into the platform. A ReAct agent you'd have to write code for in LangChain, you set up here by wiring a few nodes together. Prototyping speed is incomparably higher than with LangChain.
3.5. Extensibility
- You can write custom nodes (in TypeScript). You could package your own node that talks to an internal company service and distribute it to your team.
- There's a community node ecosystem.
- The HTTP Request node saves you every time — you can connect manually to any API that doesn't have a ready-made integration.
3.6. Workflow = JSON = a versionable artifact
When you download a flow, what you have is JSON. That means your workflow can go into Git, be the subject of a PR, and move between environments (dev → prod). Most visual tools don't offer this.
3.7. Debugging and observability
You can see each node's input and output right on the canvas; the Executions screen keeps a data-level record of past runs. You don't have to re-run the whole flow just to reproduce a bug.
3.8. A shared language across the team
The most frequently overlooked advantage: n8n isn't only used by developers. Marketing, sales, support and operations teams can work on the same canvas. That breaks the "automation request → backend queue → wait three weeks" cycle.
4. n8n’s Disadvantages and Limits
For balance:
- The learning curve is underestimated. Between the node-based interface, the item-based data model and the expression syntax, non-technical users struggle despite the “no-code” label.
- Complex flows fall apart visually. Reading a 40-node workflow can be harder than reading the 200 lines of Python that do the same job.
- Version control and testing culture are weak. JSON export exists, but diff readability is poor, and the concept of unit testing isn’t as established as it is on the code side.
- Self-hosting doesn’t mean free. Redis, Postgres, backups, monitoring and upgrade management are your responsibility. The licence is what’s free — not your time.
- The licence restriction is real. If you’re going to sell a SaaS built on n8n to customers, legal review is mandatory.
- It’s the wrong tool for heavy data processing. Moving large datasets between nodes eats memory; the right approach is to put large files in object storage and pass only references through n8n.
In Summary
I don’t think the no-code / low-code debate is worth getting hung up on. What makes n8n genuinely valuable is that it speeds developers up on projects that need automation. Zapier answers the same need; n8n’s difference is that you can run it on your own server and drop code into the middle of it.
I think we need to adapt to tools like these. They make processes visibly easier.
You don’t have to know how to code, but…
You don’t need to write line after line of code to use n8n. What you do need is a basic command of algorithmic thinking: which operation runs first, and under what condition does the flow branch where? If you can hold that left-to-right sequence in your head, the rest is drag and drop.









