N8N Tutorial: Complete Beginner's Guide to Automation 2025
Expert guide from the creators of N8N AI Automations - trusted by 127K+ students who've generated $2.7M+ in revenue.
Welcome to N8N: The Visual Automation Platform
N8N (pronounced "n-eight-n") is a powerful, open-source workflow automation tool that connects apps, services, and APIs without requiring extensive coding knowledge. Unlike traditional automation tools that lock you into proprietary platforms, N8N gives you full control with self-hosting options and unlimited workflow executions.
This comprehensive beginner's guide will take you from zero to creating production-ready automation workflows. You'll learn the fundamentals of nodes, expressions, triggers, and actions through hands-on examples that solve real business problems.
What You'll Master
- • Setting up N8N on your machine (3 installation methods)
- • Understanding the visual workflow editor
- • Creating your first automation in under 10 minutes
- • Working with triggers, nodes, and connections
- • Using expressions and data transformation
- • Connecting to popular services (Gmail, Slack, APIs)
- • Debugging workflows and handling errors
- • Best practices for production deployments
Prerequisites
No prior automation experience required! You'll need:
- • Basic computer skills and comfort with web interfaces
- • Node.js 16+ installed (or Docker for containerized setup)
- • 15-30 minutes for hands-on practice per section
Chapter 1: Installing N8N
Method 1: Quick Start with NPX
The fastest way to try N8N. Perfect for learning and testing workflows locally.
Step 1: Verify Node.js Installation
node --version # Should show v16.0.0 or higher
Step 2: Run N8N
npx n8n
This downloads N8N and starts the server. Wait for: "Editor is now accessible via http://localhost:5678"
Step 3: Access the Editor
Open your browser and navigate to:
http://localhost:5678
Create your account (stored locally) and you're ready to build!
Method 2: Docker Installation (Recommended)
Best for production use. Provides isolated environment and persistent data storage.
Basic Docker Command:
docker run -it --rm \ --name n8n \ -p 5678:5678 \ -v ~/.n8n:/home/node/.n8n \ n8nio/n8n
With Environment Variables:
docker run -it --rm \ --name n8n \ -p 5678:5678 \ -e N8N_BASIC_AUTH_ACTIVE=true \ -e N8N_BASIC_AUTH_USER=admin \ -e N8N_BASIC_AUTH_PASSWORD=your-password \ -v ~/.n8n:/home/node/.n8n \ n8nio/n8n
This adds basic authentication to secure your N8N instance.
Method 3: Global NPM Installation
Permanent installation for regular use.
Installation:
npm install -g n8n # Start N8N n8n start # Or run in background n8n start --tunnel
Pro Tip: Using Tunnel Mode
Add --tunnel to get a public URL for testing webhooks:
n8n start --tunnel # Output: Tunnel URL: https://abc123.n8n.cloud
Chapter 2: Understanding the N8N Interface
Key Interface Components
1. Canvas (Workflow Editor)
The main area where you drag, drop, and connect nodes. Use mouse wheel to zoom, click and drag to pan.
2. Node Panel (Left Sidebar)
Contains all available nodes organized by category:
- • Trigger Nodes: Start workflows (Schedule, Webhook, Manual)
- • Action Nodes: Perform operations (HTTP Request, Database, Email)
- • Logic Nodes: Control flow (IF, Switch, Merge)
- • Transform Nodes: Modify data (Set, Function, Code)
3. Node Settings Panel (Right Sidebar)
Configure selected node: parameters, credentials, expressions, and test executions.
4. Execution Panel (Bottom)
Shows workflow execution history, data passed between nodes, and error messages.
Essential Keyboard Shortcuts
Ctrl/Cmd + SSave workflow
Ctrl/Cmd + EnterExecute workflow
TabAdd new node
Delete/BackspaceDelete selected node
Ctrl/Cmd + DDuplicate node
Ctrl/Cmd + ASelect all nodes
Chapter 3: Your First Workflow (10 Minutes)
Project: Daily Weather Email Notification
Let's build a workflow that fetches weather data and sends you a daily email. This introduces triggers, HTTP requests, data transformation, and email sending.
Workflow Structure:
Schedule Trigger (Daily at 7 AM) ↓ HTTP Request (Get Weather Data) ↓ Set Node (Format Data) ↓ Gmail Node (Send Email)
Step 1: Add Schedule Trigger
- 1. Click the "+" button on canvas
- 2. Search for "Schedule Trigger"
- 3. Select "Schedule Trigger" from results
- 4. Configure trigger:
Trigger Interval: Every Day Trigger at Hour: 7 Trigger at Minute: 0
Step 2: Fetch Weather Data
Add an HTTP Request node:
- 1. Click the "+" on the Schedule Trigger node
- 2. Search for "HTTP Request"
- 3. Configure request:
Method: GET URL: https://api.open-meteo.com/v1/forecast Query Parameters: latitude: 40.7128 longitude: -74.0060 current_weather: true
This uses the free Open-Meteo API (no API key needed). Replace coordinates with your location.
Step 3: Test the Workflow So Far
Click "Execute Node" on the HTTP Request node. You should see weather data in the output panel:
{
"current_weather": {
"temperature": 72.5,
"windspeed": 10.3,
"weathercode": 1
}
}Step 4: Format the Data
Add a Set node to create a readable message:
- 1. Add "Set" node after HTTP Request
- 2. Click "Add Value" and select "String"
- 3. Name:
email_message - 4. Value (use expressions):
Good morning! Today's weather:
Temperature: {{ $json.current_weather.temperature }}°F
Wind Speed: {{ $json.current_weather.windspeed }} mph
Condition: {{ $json.current_weather.weathercode === 0 ? 'Clear' : 'Cloudy' }}Step 5: Send Email
Add Gmail node (or any email service):
- 1. Add "Gmail" node
- 2. Click "Create New Credential" and authenticate with Google
- 3. Configure email:
To: your-email@gmail.com
Subject: Daily Weather Report
Message: {{ $json.email_message }}Step 6: Save and Activate
- 1. Click "Save" in top right (or Ctrl/Cmd + S)
- 2. Name your workflow: "Daily Weather Email"
- 3. Toggle "Active" switch to ON
- 4. Your workflow now runs automatically every morning at 7 AM!
Congratulations!
You've just built your first automated workflow. You now understand triggers, HTTP requests, data transformation, and external service integration. Next, we'll dive deeper into each concept.
Chapter 4: Understanding Nodes in Depth
Trigger Nodes: Starting Your Workflows
Trigger nodes start workflow executions. Choose based on when you want your automation to run:
Schedule Trigger
Runs on a time-based schedule using cron expressions.
Examples: 0 9 * * 1-5 // 9 AM on weekdays 0 */6 * * * // Every 6 hours 0 0 1 * * // First day of each month
Webhook Trigger
Creates an HTTP endpoint that accepts external requests.
Your webhook URL:
https://your-n8n.com/webhook/my-endpoint
// Test with curl:
curl -X POST https://your-n8n.com/webhook/my-endpoint \
-H "Content-Type: application/json" \
-d '{"name": "John", "email": "john@example.com"}'Manual Trigger
Runs only when you click "Execute Workflow" button. Perfect for testing and on-demand execution.
Email Trigger (IMAP)
Monitors email inbox and triggers when new messages arrive matching your criteria.
Action Nodes: Doing the Work
Action nodes perform operations: API calls, database queries, file operations, etc.
HTTP Request
Make API calls to any HTTP endpoint. Supports GET, POST, PUT, DELETE, PATCH methods.
Database Nodes
PostgreSQL, MySQL, MongoDB, Redis. Execute queries and manage data directly.
File System
Read, write, move, delete files. Process CSV, JSON, Excel files.
Third-Party Services
450+ integrations: Google Sheets, Slack, Airtable, Notion, and more.
Logic Nodes: Controlling Flow
IF Node
Branch workflow based on conditions.
Example: Route based on email content
Condition: {{ $json.subject.includes('urgent') }}
True → Send to Slack immediately
False → Save to database for reviewSwitch Node
Multiple branches based on different conditions.
Route 0: {{ $json.status === 'new' }}
Route 1: {{ $json.status === 'processing' }}
Route 2: {{ $json.status === 'completed' }}
Route 3: Everything else (fallback)Loop Node
Iterate over arrays, process items one by one, or repeat operations.
Transform Nodes: Manipulating Data
Set Node
Create, modify, or remove fields from your data.
Add Fields:
full_name: {{ $json.first_name + ' ' + $json.last_name }}
created_date: {{ $now.toISO() }}
Remove Fields:
password, ssn, credit_cardFunction Node
Write JavaScript to transform data.
// Process all items
for (let i = 0; i < items.length; i++) {
items[i].json.email = items[i].json.email.toLowerCase();
items[i].json.timestamp = Date.now();
}
return items;Code Node
Execute custom JavaScript/Python for complex transformations. Access to npm packages.
Chapter 5: Mastering Expressions
What Are Expressions?
Expressions let you dynamically access and manipulate data as it flows through your workflow. They're written in JavaScript and wrapped in double curly braces: {{ }}
Accessing Data from Previous Nodes
{{ $json }} → All data from previous node{{ $json.email }} → Specific field{{ $json.user.address.city }} → Nested fields{{ $items }} → Array of all items{{ $items[0].json.name }} → First item's nameBuilt-in Variables and Functions
{{ $now }} → Current timestamp (Luxon DateTime){{ $now.toISO() }} → ISO format: 2025-01-15T10:30:00{{ $now.toFormat("yyyy-MM-dd") }} → 2025-01-15{{ $workflow.id }} → Current workflow ID{{ $execution.id }} → Current execution IDString Operations
{{ $json.name.toUpperCase() }} → UPPERCASE{{ $json.email.toLowerCase() }} → lowercase{{ $json.text.substring(0, 10) }} → First 10 chars{{ $json.url.replace("http://", "https://") }} → Replace text{{ $json.sentence.split(" ").length }} → Word countArray Operations
{{ $json.items.length }} → Array length{{ $json.items.map(i => i.price).join(", ") }} → Extract prices{{ $json.items.filter(i => i.active) }} → Filter active items{{ $json.numbers.reduce((a,b) => a+b, 0) }} → Sum arrayConditional Logic
{{ $json.age >= 18 ? "Adult" : "Minor" }} → Ternary operator{{ $json.status === "active" && $json.balance > 0 }} → AND logic{{ $json.role === "admin" || $json.role === "mod" }} → OR logicMath Operations
{{ $json.price * 1.2 }} → Add 20% markup{{ Math.round($json.value * 100) / 100 }} → Round to 2 decimals{{ Math.random() }} → Random number 0-1{{ Math.floor($json.amount) }} → Round downExpression Best Practices
- • Use the Expression Editor (right sidebar) to test expressions before using them
- • Check for undefined values:
{{ $json.field || "default" }} - • Use optional chaining for nested objects:
{{ $json.user?.address?.city }} - • Keep expressions simple - use Function nodes for complex logic
- • Test with sample data using "Execute Node" before activating workflow
Chapter 6: Building Real-World Workflows
Project 2: Form Submissions to Google Sheets
Capture website form submissions via webhook and log them to Google Sheets automatically.
Webhook Trigger → Validate Data → Google Sheets (Append Row) → Send Confirmation Email
Configuration Steps (Click to expand)
1. Webhook Trigger Setup:
Method: POST, Path: form-submission2. IF Node (Validate Email):
{{ $json.body.email.includes("@") && $json.body.name }}3. Google Sheets Node:
Operation: Append, Select your spreadsheet and sheet4. Respond to Webhook:
Status 200, Body: {"success": true, "message": "Form received!"}Project 3: Slack Notifications for System Monitoring
Monitor your server status via HTTP health check and send Slack alerts if it's down.
Schedule (Every 5 min) → HTTP Request (Health Check) → IF (Check Status) → Slack (Alert)
IF Node Condition:
{{ $json.statusCode !== 200 || $json.response_time > 5000 }}
True Branch → Send Slack alert
False Branch → Do nothing (workflow ends)Project 4: Social Media Cross-Posting
Post the same content to Twitter, LinkedIn, and Facebook simultaneously.
Manual Trigger → Set Node (Message) → Split In Batches → Router → Twitter/LinkedIn/Facebook
Use the Split In Batches node set to batch size 1 to post sequentially with delays, avoiding rate limits.
Chapter 7: Debugging and Error Handling
Common Debugging Techniques
1. Check Node Execution Data
After executing a workflow, click any node to see input/output data in the right panel. Look for red error indicators.
2. Use Manual Triggers for Testing
Replace Schedule/Webhook triggers with Manual Trigger while testing. Add sample data using "Set" node to simulate real inputs.
3. Add Debug Nodes
Insert "Set" nodes to inspect data at different stages:
Debug Field: {{ JSON.stringify($json, null, 2) }}4. Check Execution History
Go to "Executions" tab to see all past workflow runs, including errors and execution times.
5. Enable Error Workflows
Create a separate workflow triggered by errors:
Error Trigger → Send Alert to Slack/Email with error details
Common Errors and Solutions
Error: "Cannot read property 'X' of undefined"
Solution: Data structure doesn't match expected format. Check previous node output.
Error: "401 Unauthorized"
Solution: Credential issue. Re-authenticate or check API key validity.
Error: "Workflow did not return data"
Solution: All execution paths led to empty results. Check IF node conditions.
Error: "Execution timed out"
Solution: Workflow took too long. Optimize queries, reduce batch sizes, or increase timeout setting.
Best Practices for Production
Security
Use Environment Variables
Store API keys, passwords in environment variables, not hardcoded
Enable Authentication
Always use basic auth or OAuth for public N8N instances
Validate Webhook Inputs
Never trust incoming data - validate and sanitize
Performance
Use Batch Processing
Process items in batches instead of one-by-one
Implement Retries
Add retry logic for API calls that might fail temporarily
Monitor Executions
Regularly check execution history for errors and slow workflows
Organization
Name Workflows Clearly
Use descriptive names: "Daily-Sales-Report" not "Workflow 1"
Add Sticky Notes
Document complex logic with sticky notes on canvas
Use Tags
Organize workflows with tags: Production, Testing, Sales, etc.
Reliability
Create Error Workflows
Set up workflows to handle and alert on errors
Test Before Activating
Always test with sample data before going live
Backup Workflows
Export workflows regularly as JSON backups
Ready to Master Advanced N8N Automation?
This guide covered the fundamentals, but there's much more to learn. Our N8N AI Automations course includes 100+ pre-built workflows, advanced AI integrations, and production deployment strategies.
Explore N8N AI Automations Course