Breaking down n8n's technical foundation: the principles of node-based workflows and DAG execution, the categorization of trigger, action, function, and workflow nodes, as well as the internal architecture including the execution engine, queue mode, error handling, and retry.

In episode 1 you understood what n8n is, its history, and why it deserves to be chosen. Now it's time to open the hood: how n8n actually works on the inside.
This episode covers n8n's core concepts and architecture — the principles of node-based workflows and DAG execution, the types of nodes (trigger, action, function, and workflow nodes), as well as the internal workings including the execution queue, error handling, and retry. After this episode, you'll read an n8n workflow structure like reading a map, not a puzzle.
In n8n, a workflow is a chain of connected nodes. One node represents one step: it receives input, processes it, then produces output. Data flows following the direction of connections from the trigger at the start to the final node.
The first key concept: n8n executes flows shaped like a DAG (Directed Acyclic Graph) — a directed graph without cycles. This means:
SplitInBatches).{
"name": "contoh-dag",
"nodes": [
{ "name": "Webhook", "type": "n8n-nodes-base.webhook", "typeVersion": 2 },
{ "name": "HTTP Request", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4 },
{ "name": "IF", "type": "n8n-nodes-base.if", "typeVersion": 2 }
],
"connections": {
"Webhook": { "main": [[{ "node": "HTTP Request" }]] },
"HTTP Request": { "main": [[{ "node": "IF" }]] }
}
}The structure above is the native representation of a workflow in n8n: the nodes array contains the definition of each node, and the connections object describes who connects to whom. Reading this format — which you can export at any time — helps you understand that the visual editor is just a map of this data. In practice, a workflow can be exported to a JSON file with n8n export:workflow and imported back with n8n import:workflow.
When a trigger fires an execution, n8n runs the nodes in DAG order. Each node receives items — an array of JSON objects — from its input, processes them, then sends the results to the next node. This single execution is recorded, complete with each node's output, so it can be audited and debugged later.
Nodes in n8n can be categorized by their role:
| Category | Examples | Function |
|---|---|---|
| Trigger node | Webhook, Schedule Trigger, Manual Trigger | Starts an execution when an event/schedule arrives |
| Action node | HTTP Request, Email, Slack, Postgres | Performs real operations on external systems |
| Function / Code node | Code, Function | Transforms data with JavaScript |
| Workflow control node | IF, Switch, Merge, SplitInBatches | Branching, merging, and looping |
| Workflow node | Execute Workflow, Sub-workflow | Calls another workflow as a single step |
| Helper node | Set, Remove Duplicates, Wait | Tidies up and prepares data |
This breakdown is important for reading other people's workflows quickly: the moment you see a Webhook node at the start, you immediately know it's a trigger; an HTTP Request node in the middle is an action; an IF node is a branch.
A real example: to process custom data, you place a Code node that receives an array of items and returns a new array:
const nama = $json.nama || "anonim";
const pesan = `Halo, ${nama}!`;
return [{ json: { pesan, waktu: Date.now() } }];Every element returned must have a json key. This pattern is what makes n8n flexible — you're not limited to visual configuration, you can write logic directly.
Behind the scenes, n8n is made up of several main components:
In standard (main-process) mode, a single n8n instance does everything — UI, execution, and storage. For large scale, queue mode separates execution into a Redis queue and separate workers, so the UI doesn't stutter under high load. We'll break down this scaling detail in the self-hosting episode.
Executions rarely run smoothly without a hitch. n8n handles failures on several layers:
These concepts are the foundation of "hardy workflows" whose practical implementation you'll learn in the error handling episode. For now, just remember: failure isn't the end — n8n gives you many levers to decide what happens after an error.
Let's summarize all the concepts into one real execution flow:
This flow applies to almost every workflow, from the simplest to complex production pipelines.
Info
Get used to seeing workflows as DAGs and data as arrays of JSON items. These two mental models will make all the following episodes — transformations, error handling, up to scaling — much easier to digest.
This episode opened n8n's black box: a workflow is a DAG of nodes, each processing an array of JSON items; nodes are categorized into trigger, action, function, workflow control, and helper; behind it all stand the engine, credential store, database, and worker; and failures are handled through retry, continue on fail, and error workflows.
Key takeaways:
json and binary keys.In the next episode, we'll get down to practice: installation and basic setup — running n8n locally, self-hosted options with Docker Compose, Kubernetes, and n8n Cloud, plus setting up the credential store, environment variables, and basic configuration. See you there!