n8n Tutorial: The Complete Beginner's Guide to Workflow Automation
AutomationTechnology

n8n Tutorial: The Complete Beginner's Guide to Workflow Automation

Learn n8n from scratch with this hands-on tutorial. Build your first workflow, master nodes and triggers, and explore 5 essential automations for business productivity.

JM

Jason Macht

Founder @ White Space

February 17, 2026
15 min read

I've been working with automation tools for years now, and I keep coming back to n8n for a simple reason: it's the only platform where I don't feel like I'm fighting against artificial limitations. Want to run 50,000 workflow executions a month? Go ahead. Need to write custom JavaScript inside your workflow? Built right in. Want to host everything on your own server for complete data control? That's the default option.

Last month, a client asked me to help them automate their lead capture process. They were paying $200/month on Make.com because of high volume. We migrated everything to n8n self-hosted, and now they're running unlimited executions on a $15/month VPS. Same functionality, 93% cost reduction.

That's the power of n8n when you know how to use it. And that's exactly what I'm going to teach you in this guide.

Let's go ahead and jump into it.

What Is n8n?

n8n (pronounced "n-eight-n") is an open-source workflow automation platform that lets you connect apps, services, and APIs to automate repetitive tasks. Think of it as a visual programming environment where you drag and drop "nodes" that represent actions, then connect them to create automated workflows.

The name stands for "node to node," which perfectly describes how it works: data flows from one node to the next, getting transformed, filtered, or routed along the way.

What makes n8n different from other automation tools is the combination of visual building and code access. You get the ease of a drag-and-drop interface, but you can also drop into JavaScript whenever you need custom logic. It's the best of both worlds.

n8n vs Zapier vs Make.com

Before we dive into the tutorial, let's clarify where n8n fits in the automation landscape.

Featuren8nZapierMake.com
Pricing ModelPer execution (or free self-hosted)Per taskPer credit (operation)
Self-HostingYes (Community Edition is free)NoNo
Code AccessFull JavaScript in every workflowLimitedLimited
AI Capabilities70+ AI nodes, LangChain built-inBasic AI actionsBasic AI modules
Learning CurveMediumLowEasy-Medium
Best ForDevelopers, technical teams, high-volumeSimple automations, beginnersVisual builders, marketing teams

The key differences:

  • Zapier is the easiest to learn but charges per task. A 5-step workflow = 5 tasks. That adds up fast.
  • Make.com has beautiful visual workflows and charges per operation (action). Better value than Zapier, but costs scale with complexity.
  • n8n charges per execution, not per node. A 200-step workflow still counts as one execution. And if you self-host, executions are unlimited.

For a deeper comparison, check out my Make.com vs n8n vs Claude Code comparison.

My take: If you're technical (or willing to learn), n8n offers the best value and flexibility. If you just need simple automations without touching any technical concepts, start with Make.com and migrate to n8n when costs become a factor.

Setting Up n8n

You have two options for running n8n: cloud-hosted or self-hosted. Let me break down both.

Option 1: n8n Cloud (Easiest)

The fastest way to get started is n8n Cloud. Sign up, and you're building workflows in minutes. No server setup, no maintenance headaches.

Current cloud pricing (as of 2026):

  • Starter: $20/month for 2,500 executions
  • Pro: ~$60/month for 10,000 executions
  • Business: $800/month for 40,000 executions + advanced security

Pros: Zero setup, automatic updates, managed infrastructure Cons: Per-execution costs, data lives on n8n's servers

Option 2: Self-Hosted (Most Flexible)

This is where n8n really shines. The Community Edition is completely free—unlimited workflows, unlimited executions, unlimited users. You only pay for hosting.

Quick Docker setup:

# Pull the n8n image
docker pull n8nio/n8n

# Run n8n with persistent data
docker run -it --rm \
  --name n8n \
  -p 5678:5678 \
  -v ~/.n8n:/home/node/.n8n \
  n8nio/n8n

Open http://localhost:5678 and you're running n8n locally.

For production deployment, I recommend using Docker Compose with a proper database:

# docker-compose.yml
version: '3.8'

services:
  n8n:
    image: n8nio/n8n
    restart: always
    ports:
      - "5678:5678"
    environment:
      - N8N_BASIC_AUTH_ACTIVE=true
      - N8N_BASIC_AUTH_USER=admin
      - N8N_BASIC_AUTH_PASSWORD=your-secure-password
      - N8N_HOST=n8n.yourdomain.com
      - N8N_PROTOCOL=https
      - WEBHOOK_URL=https://n8n.yourdomain.com/
      - DB_TYPE=postgresdb
      - DB_POSTGRESDB_HOST=postgres
      - DB_POSTGRESDB_DATABASE=n8n
      - DB_POSTGRESDB_USER=n8n
      - DB_POSTGRESDB_PASSWORD=your-db-password
    volumes:
      - n8n_data:/home/node/.n8n
    depends_on:
      - postgres

  postgres:
    image: postgres:15
    restart: always
    environment:
      - POSTGRES_USER=n8n
      - POSTGRES_PASSWORD=your-db-password
      - POSTGRES_DB=n8n
    volumes:
      - postgres_data:/var/lib/postgresql/data

volumes:
  n8n_data:
  postgres_data:

Typical VPS costs: $5-20/month on providers like Hetzner, DigitalOcean, or Vultr. I've seen teams run 50,000+ executions monthly on a $15 VPS without breaking a sweat.

First-Time Configuration

Once n8n is running, you'll want to configure a few things:

  1. Set up credentials - Go to Settings > Credentials and connect your apps (Google, Slack, etc.)
  2. Configure timezone - Important for scheduled workflows
  3. Set up SMTP - For email notifications on workflow failures
  4. Enable execution saving - Keeps logs of all workflow runs for debugging

Understanding n8n Concepts

Before building workflows, let's nail down the core concepts. Understanding these will save you hours of confusion later.

Nodes: The Building Blocks

Everything in n8n is a node. Nodes are the individual steps in your workflow—each one performs a specific action.

Types of nodes:

  • Trigger Nodes - Start your workflow (webhook received, schedule hit, new email arrived)
  • Action Nodes - Do something (send email, create record, make API call)
  • Logic Nodes - Control flow (IF conditions, loops, merges)
  • Transform Nodes - Modify data (set values, split arrays, aggregate results)

Think of nodes as Lego blocks. Each one does something specific, and you snap them together to build complex automations.

Connections: The Data Flow

Nodes connect via lines that show how data flows through your workflow. Data always moves left to right—from trigger through each subsequent node.

Key concept: Each node receives data from the previous node, processes it, and passes the result to the next node. If a node outputs multiple items, the next node runs once for each item.

Triggers vs Actions

Triggers start your workflow. Common triggers include:

  • Webhook - External service calls your n8n URL
  • Schedule - Runs at specified times (cron syntax)
  • App triggers - New email, new form submission, new Slack message

Actions do work inside your workflow:

  • Send emails
  • Create CRM records
  • Update spreadsheets
  • Call APIs

Pro tip: A workflow can only have ONE trigger, but it can have unlimited actions. If you need multiple triggers for the same logic, create separate workflows that share a sub-workflow.

Data Flow and Expressions

Data in n8n flows as JSON. Each node receives items (array of objects) and outputs items. You access data from previous nodes using expressions:

// Access data from the previous node
{{ $json.email }}

// Access data from a specific node by name
{{ $('Google Sheets').item.json.firstName }}

// Access the current item index
{{ $itemIndex }}

// Use JavaScript expressions
{{ $json.email.toLowerCase() }}

The expression editor supports full JavaScript, so you can transform data however you need:

// Combine first and last name
{{ $json.firstName + ' ' + $json.lastName }}

// Format a date
{{ new Date($json.createdAt).toLocaleDateString() }}

// Conditional value
{{ $json.status === 'active' ? 'Yes' : 'No' }}

Building Your First Workflow: Email to Slack Notification

Let's build something practical: a workflow that monitors a Gmail inbox and sends a Slack notification when emails from specific senders arrive. This is useful for alerting your team when important emails come in.

Step 1: Create a New Workflow

  1. Log into n8n
  2. Click "New Workflow" in the top right
  3. You'll see a blank canvas with a "+" button

Step 2: Add the Gmail Trigger

  1. Click the "+" and search for "Gmail"
  2. Select "Gmail Trigger"
  3. Choose "Message Received" as the trigger event
  4. Click "Create New Credential" to connect your Google account
  5. Configure the trigger:
    • Mailbox: INBOX
    • Filter: from:important-client@example.com (customize this)
    • Simple: No (gives us full email data)

Step 3: Add the Slack Node

  1. Click the "+" after the Gmail node
  2. Search for "Slack" and select it
  3. Choose "Send a Message"
  4. Connect your Slack workspace
  5. Configure the message:
    • Channel: #notifications (or your preferred channel)
    • Text:
    New email from {{ $json.from.value[0].address }}
    
    Subject: {{ $json.subject }}
    
    Preview: {{ $json.snippet }}
    

Step 4: Test Your Workflow

  1. Click "Test Workflow" at the bottom
  2. Send yourself a test email matching your filter
  3. Watch the data flow through each node
  4. Check that the Slack message appears correctly

Step 5: Activate

  1. Toggle the workflow to "Active" in the top right
  2. Set the polling interval (how often Gmail checks for new emails)
  3. Your automation is now live

Workflow diagram:

[Gmail Trigger] → [Slack: Send Message]
     ↓                    ↓
 "New email         "Posts to
  arrives"           #notifications"

That's it. Every time an email matches your filter, your team gets a Slack notification within seconds.

5 Essential n8n Workflows for Business

Now that you understand the basics, here are five workflows I build repeatedly for clients. Each solves a real problem and can be customized for your specific tools.

1. Lead Capture to CRM

Trigger: Webhook (receives form submissions)

Flow:

  1. Webhook receives form data
  2. IF node checks if lead exists in CRM
  3. If yes: Update existing contact
  4. If no: Create new contact
  5. Add to email marketing list
  6. Send Slack notification to sales team
  7. Create follow-up task in project management tool

Why it matters: No more leads sitting in form responses for hours. Every submission is in your CRM within seconds, with automatic follow-up tasks created.

Key nodes used: Webhook, IF, HubSpot/Pipedrive, Mailchimp/Customer.io, Slack, Asana/Monday

2. Social Media Content Distribution

Trigger: Schedule (daily at 9 AM) or RSS feed

Flow:

  1. Trigger fires on schedule
  2. Fetch latest blog post from RSS or CMS
  3. Generate social-specific versions (Twitter length, LinkedIn format)
  4. Post to Twitter/X via API
  5. Post to LinkedIn
  6. Create Buffer scheduled posts for later
  7. Log to Google Sheets for tracking

Why it matters: Every piece of content you publish gets distributed across all platforms automatically. No more forgetting to promote your latest post.

Key nodes used: Schedule, RSS Read, HTTP Request, Set, Twitter, LinkedIn, Google Sheets

3. Data Sync Between Apps

Trigger: Schedule (every 15 minutes)

Flow:

  1. Fetch new/updated records from source (e.g., Airtable)
  2. Loop through each record
  3. Check if record exists in destination (e.g., Google Sheets)
  4. If exists: Update row
  5. If not: Insert new row
  6. Log sync results

Why it matters: Keep your data sources in sync without manual exports/imports. Changes in one system automatically reflect in another.

Key nodes used: Schedule, Airtable, Loop, IF, Google Sheets

4. Automated Weekly Reports

Trigger: Schedule (Monday 8 AM)

Flow:

  1. Pull sales data from Stripe
  2. Pull lead data from CRM
  3. Pull task completion from project tool
  4. Aggregate metrics with Code node
  5. Generate formatted report with HTML
  6. Send via email to leadership team
  7. Post summary to Slack

Why it matters: Leadership gets consistent visibility into key metrics without anyone manually building reports.

Key nodes used: Schedule, Stripe, HubSpot, Asana, Code, Merge, Send Email, Slack

5. Customer Onboarding Sequence

Trigger: Webhook (new payment from Stripe)

Flow:

  1. Receive payment webhook
  2. Create customer record in CRM
  3. Create onboarding task for team
  4. Wait 1 hour (Wait node)
  5. Send welcome email
  6. Wait 3 days
  7. Send check-in email
  8. Create 7-day follow-up task

Why it matters: Every customer gets a consistent, professional onboarding experience regardless of how busy your team is.

Key nodes used: Webhook, HubSpot, Asana, Wait, Send Email, If (check email opens)

Advanced n8n Features

Once you're comfortable with basic workflows, these features unlock serious power.

Code Node: Custom JavaScript

The Code node lets you write JavaScript inside your workflow. This is incredibly powerful for data transformation:

// Code node example: Process and enrich lead data
const items = $input.all();

return items.map(item => {
  const email = item.json.email;
  const domain = email.split('@')[1];

  return {
    json: {
      ...item.json,
      // Add computed fields
      emailDomain: domain,
      isBusinessEmail: !['gmail.com', 'yahoo.com', 'hotmail.com'].includes(domain),
      leadScore: calculateLeadScore(item.json),
      createdAt: new Date().toISOString()
    }
  };
});

function calculateLeadScore(lead) {
  let score = 0;
  if (lead.companySize > 50) score += 20;
  if (lead.budget > 10000) score += 30;
  if (lead.timeline === 'immediate') score += 25;
  return score;
}

AI Nodes and LangChain Integration

n8n has over 70 AI-specific nodes, making it one of the best platforms for building AI-powered automations:

Available AI capabilities:

  • OpenAI/Anthropic nodes - Chat completions, embeddings, image generation
  • LangChain integration - Build sophisticated AI chains with memory and tools
  • Vector database nodes - Pinecone, Supabase, Qdrant for RAG systems
  • AI Agent node - Let AI decide which tools to use based on input

Example: AI-powered email categorization

[Email Trigger] → [AI: Classify] → [Switch] → [Route to appropriate action]

The AI node can categorize incoming emails as "support," "sales," "spam," etc., then route each to the appropriate workflow path.

Error Handling

Robust workflows need error handling. n8n provides several mechanisms:

Try/Catch pattern:

[Main Workflow] → [Error Trigger] → [Send Alert]
                         ↓
                 [Log to Spreadsheet]

Retry on failure: In node settings, enable "Retry On Fail" with configurable attempts and delays.

Continue on fail: Enable "Continue On Fail" when a node's failure shouldn't stop the entire workflow.

Error workflow: Set a dedicated workflow to run whenever any workflow fails. Use this to send Slack alerts or create incident tickets.

n8n Best Practices

After building hundreds of workflows, here's what I've learned about keeping things maintainable.

Organization

  1. Name workflows descriptively - "Lead Capture to HubSpot + Slack" beats "Workflow 7"
  2. Use sticky notes - Add notes to your canvas explaining complex logic
  3. Group related workflows - Use folders to organize by function (Sales, Marketing, Operations)
  4. Color-code nodes - n8n lets you color nodes; use this for visual organization

Testing

  1. Test with real data - Use "Execute Workflow" with actual inputs before activating
  2. Test edge cases - What happens with empty fields? Duplicates? Unexpected formats?
  3. Use test credentials - Set up sandbox accounts for apps when possible
  4. Check execution logs - Review past executions regularly to catch silent failures

Performance

  1. Batch operations - Many nodes support batching; use it to reduce API calls
  2. Filter early - Add IF nodes early to skip unnecessary processing
  3. Limit data - Don't fetch 10,000 records when you only need 100
  4. Use caching - For expensive API calls, cache results when possible
  5. Monitor execution times - Long-running workflows may need optimization

Security

  1. Rotate credentials regularly - Especially for production workflows
  2. Use environment variables - Store sensitive values in n8n settings, not in workflows
  3. Limit webhook exposure - Use webhook authentication when possible
  4. Audit access - Review who has access to your n8n instance

FAQ

Q: Is n8n really free for self-hosting?

Yes. The Community Edition is genuinely free with unlimited executions, workflows, and users. You only pay for your own server hosting (typically $5-20/month). There are no hidden fees or execution limits.

Q: How hard is it to self-host n8n?

If you can follow a tutorial and copy-paste commands, you can self-host n8n. The Docker setup takes about 15 minutes. For production use, I recommend spending an hour on proper configuration with SSL and backups, but it's not complicated.

Q: Can I use n8n without coding?

Absolutely. The visual builder handles most automation needs without any code. The Code node is optional—it's there when you need it, but most workflows never touch it.

Q: How does n8n compare to Zapier for beginners?

Zapier is easier for your first automation. But once you've built a few workflows and understand the concepts, n8n isn't much harder—and it's significantly more powerful and cost-effective.

Q: What if an app I need isn't supported?

n8n has 1,000+ integrations, but if yours isn't there, use the HTTP Request node to call any API directly. You can also build custom nodes if you need reusable integrations.

Q: How do I handle sensitive data in n8n?

Self-hosted n8n gives you complete data control—nothing leaves your server. For cloud n8n, they're SOC 2 compliant with encryption at rest and in transit. For highly regulated data (healthcare, finance), self-hosting is the safer choice.

Q: Can n8n handle high-volume workflows?

Yes. I've seen production instances handling 100,000+ executions daily on modest hardware. Use PostgreSQL instead of SQLite for better performance, and configure worker processes for parallel execution.

What's Next?

You now have everything you need to start building real automations with n8n. Here's my suggested progression:

Week 1: Set up n8n (cloud or self-hosted) and build 2-3 simple workflows using the examples in this guide.

Week 2: Identify your biggest time-wasting manual processes and automate one.

Week 3: Explore AI nodes and more advanced features like sub-workflows and error handling.

Week 4: Optimize and document your workflows for long-term maintenance.

The ROI on automation is real—I've seen businesses save 10-20 hours per week once they get serious about it. And with n8n's pricing model, those savings don't get eaten by platform costs as you scale.

If you want help identifying automation opportunities or building more complex workflows, check out our services. We've deployed n8n for dozens of businesses and can help you get the most out of it.

For more automation insights, see our guide on small business automation with Make.com to understand when each tool makes sense.

That's all I got for now. Until next time.

Want to get more out of your business with automation and AI?

Let's talk about how we can streamline your operations and save you time.