To build your first n8n workflow, install n8n via Docker or npm, open the canvas editor, add a trigger node (such as a Webhook or Schedule trigger), connect action nodes for your desired operations, configure data mapping between nodes, and activate the workflow. n8n is free and open-source, so you can self-host it on any server and run unlimited executions at no cost.
What Is n8n and Why Use It?
n8n is an open-source workflow automation platform that lets you connect any app or service using a visual node-based editor. Unlike Zapier or Make, n8n can be self-hosted on your own infrastructure, which means your data never leaves your servers and you never pay per-execution fees. It supports over 400 built-in integrations and lets you write custom JavaScript or Python code directly in workflow nodes. The platform has seen explosive growth in the automation community — its GitHub repository has surpassed 50,000 stars, and its active contributor base ships new integrations weekly.
Install n8n (Docker, npm, or Cloud)
Installation is straightforward whether you prefer Docker, npm, or n8n's managed cloud service. For Docker, a single command gets you running: docker run -it --rm -p 5678:5678 n8nio/n8n. For a persistent setup, use Docker Compose with a PostgreSQL database backend so your workflows and credentials survive container restarts. If you prefer npm, install globally with npm install -g n8n and run the n8n command. The managed n8n Cloud option skips all infrastructure setup and offers a free tier with limited executions — this is the fastest way to start learning without touching a terminal.
Understand the Canvas and Node Model
The n8n canvas is where you design workflows by placing and connecting nodes. Every workflow starts with a trigger node on the left side — this defines what event initiates the workflow. You then chain action nodes to the right, each performing a specific operation. Data flows from left to right through connections, and each node receives the output of the previous node as its input. You can branch workflows using If/Switch nodes, merge parallel branches with Merge nodes, and loop over arrays with the Loop Over Items node. The canvas is drag-and-drop, and you can zoom, pan, and organize nodes freely.
Choose Your Trigger Node
Trigger nodes are the entry point for every workflow, and choosing the right one matters. The Webhook trigger exposes a URL that external systems can POST data to — ideal for receiving form submissions, payment events, or CRM updates. The Schedule trigger runs your workflow on a cron schedule — use it for daily reports, periodic data syncs, or cleanup tasks. The Email Trigger monitors an inbox and fires when new messages arrive. App-specific triggers like the Slack Trigger or GitHub Trigger listen for events within those platforms natively. For your first workflow, the Webhook trigger is the most versatile starting point because you can test it instantly using tools like curl or Postman.
Build a Lead Capture Workflow Step by Step
Let us build a practical first workflow: a lead capture pipeline that receives a form submission via webhook, enriches the data, sends a Slack notification, and creates a CRM record. Start by adding a Webhook node and setting the HTTP method to POST. Copy the test webhook URL. Next, add a Set node to reshape the incoming data — map the form fields to clean variable names. Add an HTTP Request node to call an enrichment API (like Clearbit) using the lead's email. Connect a Slack node configured to post a formatted message to your sales channel. Finally, add a HubSpot or Airtable node to create the lead record.
Master Data Mapping With Expressions
Data mapping is the skill you will use more than any other in n8n. Every node outputs JSON data, and downstream nodes reference that data using expressions. Click on any input field and toggle to expression mode to access data from previous nodes. The syntax uses double curly braces: {{ $json.fieldName }} references a field from the immediately preceding node. Use {{ $node['NodeName'].json.fieldName }} to reach back to any specific node's output. n8n's expression editor provides autocomplete and a preview panel that shows the resolved value — use this constantly to verify your mappings are correct before running the workflow.
Add Error Handling From Day One
Error handling separates throwaway experiments from production-grade workflows. n8n offers two mechanisms: node-level retry and the Error Trigger workflow. On any node, open Settings and enable Retry On Fail with a configurable number of attempts and wait time between retries — this handles transient API failures gracefully. For unrecoverable errors, create a separate Error Workflow containing an Error Trigger node. When any workflow in your n8n instance fails, the Error Trigger fires with the error details, the failed workflow name, and the execution data. Use this to send yourself a Slack alert or email with all the context you need to diagnose the issue. At The Provider System, every production workflow has an associated error workflow — no exceptions.
Test Your Workflow Thoroughly
Testing in n8n uses the built-in execution panel. Click Execute Workflow to run the entire chain manually, or click Execute Node on any individual node to test it in isolation with sample data. The output panel on the right shows the exact JSON each node produces, which makes debugging data mapping issues straightforward. For webhook-triggered workflows, use the Test URL (which differs from the production URL) — it pauses the workflow after the trigger and lets you step through nodes one at a time. Always test with realistic data including edge cases like empty fields, special characters, and unexpected data types.
Activate, Monitor, and Maintain
Once your workflow runs correctly, activate it by toggling the Active switch in the top-right corner. Active workflows respond to their trigger events in real time. Monitor executions in the Executions tab, which logs every run with its status, duration, and full data trail. You can filter by success, error, or running status. Click into any execution to see exactly what data flowed through each node — this is invaluable for diagnosing issues reported by users. Set retention policies for execution data to manage database size, especially on self-hosted instances with high-volume workflows.
Level Up With Advanced Features
As you get comfortable, explore n8n's more powerful features. The Code node lets you write arbitrary JavaScript or Python for complex transformations that visual nodes cannot handle. The Sub-Workflow node lets you call other workflows as reusable functions — build a library of common operations like send formatted email or enrich lead data and invoke them across multiple parent workflows. The AI Agent node connects LLMs with tool-calling capabilities, enabling you to build autonomous agents that reason and take actions. The HTTP Request node with pagination support lets you bulk-import data from any REST API, handling cursor-based or page-number pagination automatically.
Essential n8n Node Types and Their Uses
| Node Category | Key Nodes | Common Use Cases | Complexity Level |
|---|---|---|---|
| Triggers | Webhook, Schedule, Email Trigger, App Triggers | Receive external events, run on schedule, react to app events | Beginner |
| Core Actions | HTTP Request, Set, If, Switch, Code | Call APIs, transform data, add conditional logic, write custom code | Beginner–Intermediate |
| Flow Control | Merge, Loop Over Items, Split In Batches, Wait | Combine branches, iterate arrays, batch process, add delays | Intermediate |
| Data Transformation | Set, Spreadsheet File, XML, HTML Extract, Markdown | Reshape data, parse files, extract structured data from web pages | Beginner–Intermediate |
| App Integrations | Slack, Google Sheets, HubSpot, Airtable, Gmail | Read/write data to third-party apps via native connectors | Beginner |
| AI Nodes | AI Agent, OpenAI, LLM Chain, Vector Store, Text Classifier | Build AI agents, classify text, query knowledge bases, generate content | Intermediate–Advanced |
| Utilities | Error Trigger, Execute Workflow, Crypto, Date & Time | Handle errors, call sub-workflows, encrypt data, format dates | Intermediate |
Sources & References
- n8n.io. 'n8n Documentation: Getting Started.' https://docs.n8n.io/. Accessed 2025.
- n8n.io. 'n8n GitHub Repository.' https://github.com/n8n-io/n8n. Accessed January 2025.
- Docker. 'Docker Hub: n8n.' https://hub.docker.com/r/n8nio/n8n. Accessed 2025.