DEV Community

Alex Spinov
Alex Spinov

Posted on

n8n Has a Free Self-Hosted API — Here's How to Automate Anything Without Zapier

A marketing team I know was paying $300/month for Zapier to connect 15 integrations. They switched to self-hosted n8n — same automations, unlimited executions, $5/month for the VPS.

What n8n Offers

n8n self-hosted (free forever):

  • Unlimited workflows and unlimited executions
  • 400+ integrations — Slack, Gmail, Notion, Airtable, Stripe, etc.
  • Visual workflow builder — drag-and-drop
  • Code nodes — write JavaScript/Python when you need flexibility
  • Webhooks — trigger workflows from any API
  • Cron triggers — scheduled workflows
  • REST API — manage workflows programmatically
  • Sub-workflows — modular, reusable automation

n8n Cloud starts at $20/month.

Quick Start (Self-Hosted)

# Docker (simplest)
docker run -it --rm \
  -p 5678:5678 \
  -v n8n_data:/home/node/.n8n \
  n8nio/n8n

# Access at http://localhost:5678
Enter fullscreen mode Exit fullscreen mode

REST API

# List workflows
curl 'http://localhost:5678/api/v1/workflows' \
  -H 'X-N8N-API-KEY: YOUR_API_KEY'

# Execute a workflow
curl -X POST 'http://localhost:5678/api/v1/workflows/WORKFLOW_ID/execute' \
  -H 'X-N8N-API-KEY: YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"data": {"customer": "Alice", "amount": 99.99}}'

# Create a workflow
curl -X POST 'http://localhost:5678/api/v1/workflows' \
  -H 'X-N8N-API-KEY: YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "New Customer Alert",
    "nodes": [...],
    "connections": {...},
    "active": true
  }'

# Get execution history
curl 'http://localhost:5678/api/v1/executions?workflowId=WORKFLOW_ID&limit=10' \
  -H 'X-N8N-API-KEY: YOUR_API_KEY'
Enter fullscreen mode Exit fullscreen mode

Webhook Trigger

# n8n creates webhook URLs automatically
# Trigger from any app:
curl -X POST 'http://localhost:5678/webhook/YOUR_WEBHOOK_PATH' \
  -H 'Content-Type: application/json' \
  -d '{
    "event": "order.created",
    "customer_email": "alice@example.com",
    "amount": 49.99
  }'

# n8n workflow handles it:
# 1. Webhook receives data
# 2. Look up customer in CRM
# 3. Send welcome email via Gmail
# 4. Create task in Notion
# 5. Post to Slack channel
Enter fullscreen mode Exit fullscreen mode

Code Node (When Visual Isn't Enough)

// Inside n8n's Code node:
const items = $input.all();
const results = [];

for (const item of items) {
  const { name, email, plan } = item.json;

  // Custom logic
  const tier = plan === 'enterprise' ? 'high' : 'standard';
  const assignee = tier === 'high' ? 'sales-team' : 'auto';

  results.push({
    json: { name, email, tier, assignee, processedAt: new Date().toISOString() }
  });
}

return results;
Enter fullscreen mode Exit fullscreen mode

Common Automation Examples

1. Lead Enrichment

  • Webhook receives form submission
  • Clearbit enriches company data
  • Route to CRM (HubSpot/Pipedrive)
  • Notify sales on Slack

2. Content Pipeline

  • RSS feed new posts
  • Summarize with AI (OpenAI node)
  • Post to Slack + Twitter
  • Log to Google Sheets

3. Customer Onboarding

  • Stripe payment webhook
  • Create account in database
  • Send welcome email sequence
  • Add to newsletter list
  • Create project in Notion

4. Monitoring

  • Cron: every 5 minutes
  • HTTP Request: check API health
  • If down: PagerDuty alert + Slack message
  • Log to Google Sheets

n8n vs Zapier

n8n (Self-Hosted) Zapier
Unlimited executions 100 tasks/month free
$5/month (VPS) $20-600/month
Self-hosted data Cloud only
Code nodes Limited coding
400+ integrations 6,000+ integrations
Open source Proprietary

Need to automate web scraping? Check out my web scraping actors on Apify — integrate with n8n for full automation.

Need custom automation? Email me at spinov001@gmail.com.

Top comments (0)