What is n8n and Why It Matters

n8n is an open-source workflow automation tool that lets you connect APIs and services through a visual node-based interface. Unlike fully managed platforms such as Zapier, n8n gives you the option to self-host, write custom JavaScript inside nodes, and call any HTTP endpoint — which makes it practical for developers who need automation without losing control.

The core idea is straightforward: instead of writing a script that fetches data from Service A, transforms it, and pushes it to Service B, you build a workflow where each step is a visible, configurable node. The result is the same, but the workflow is easier to debug, hand off, and modify without touching code every time.

Core Concepts You Need Before Anything Else

Every workflow in n8n is built from three primitives: nodes, connections, and executions.

A node is a single unit of work. It can trigger on an event, fetch data from an API, transform a value, or send a notification. Connections are the arrows between nodes — they define the order of operations and pass data downstream. An execution is one complete run of a workflow, from trigger to final node.

flowchart showing Trigger Node -> Transform Node -> Action Node with labeled arrows for data passing between steps

Data inside n8n flows as an array of items. Each item is a JSON object. When a node receives five records from a database query, downstream nodes process all five items by default — no explicit loop needed. This is one of the most important behaviors to internalize early, because it affects how you design every workflow.

Here is what a single item looks like as it travels between nodes:

json
{
"id": 42,
"email": "user@example.com",
"status": "active"
}

And when a node outputs multiple items, n8n wraps them in an array and the next node receives all of them automatically.

Execution Modes and Trigger Types

n8n workflows start from a trigger node. There are three common trigger patterns you will use constantly.

The first is a webhook trigger. An external service sends an HTTP POST to a URL n8n provides, and the workflow fires immediately. This is the right choice when you need real-time reactions — a new payment, a form submission, a GitHub push event.

The second is a schedule trigger. The workflow runs on a cron expression you define. Use this for polling jobs, daily reports, or any task where real-time is not a requirement.

The third is a manual trigger, which you click inside the editor. This is only for testing and development — do not ship workflows that rely on it.

A running n8n instance in production mode executes active workflows automatically. In development, you activate a workflow by toggling it from inactive to active inside the editor.

When to Use n8n vs. Custom Code

This is the integration mindset question developers always ask: why not just write the script myself?

Custom code wins when the logic is genuinely complex — multi-step conditional branching, stateful operations, or performance-sensitive data processing. A Python script that processes 500,000 rows with NumPy is the right tool for that job.

n8n wins when the work is mostly orchestration: call this API, reshape the response, send it somewhere else, notify a person if something fails. The overhead of writing, deploying, monitoring, and maintaining a custom integration script is real. n8n handles retries, execution logs, error workflows, and credential management out of the box.

comparison diagram showing two paths: left path Custom Code with steps Write, Deploy, Monitor, Debug; right path n8n with steps Configure, Activate, Inspect Logs

A practical heuristic: if your integration would take more than a day to build in code but could be done in two hours in n8n, and the logic does not require something n8n cannot express, use n8n. You can always drop into a Code node when you hit the limits of visual configuration — that is covered in a later lesson.

Summary

n8n is best understood as a programmable integration layer, not a no-code toy. Nodes, connections, and executions are the three building blocks. Data flows as arrays of JSON items between nodes. Trigger types — webhook, schedule, and manual — determine when a workflow runs. The integration mindset means choosing the right tool for each task: use n8n to reduce operational overhead for orchestration work, and reach for custom code when the logic genuinely demands it.