DEV Community

Alex Spinov
Alex Spinov

Posted on

n8n Has a Free API: Build Automations Without Code (Open-Source Zapier Alternative)

What is n8n?

n8n is an open-source workflow automation platform — like Zapier or Make, but self-hostable and with a code option. Connect 400+ services, build complex workflows visually, and add custom JavaScript/Python when visual nodes are not enough.

Why n8n Over Zapier?

  • Self-host for free — unlimited workflows, unlimited executions
  • Code when needed — JavaScript/Python nodes for custom logic
  • 400+ integrations — plus HTTP node for any API
  • Sub-workflows — modular, reusable automation components
  • Error handling — retry, fallback, error workflows
  • AI nodes — built-in OpenAI, Anthropic, local LLM support

Quick Start (Self-Host)

# Docker (quickest)
docker run -it --rm -p 5678:5678 n8nio/n8n

# Docker Compose (persistent)
version: '3'
services:
  n8n:
    image: n8nio/n8n
    ports:
      - 5678:5678
    volumes:
      - n8n_data:/home/node/.n8n
    environment:
      - N8N_BASIC_AUTH_ACTIVE=true
      - N8N_BASIC_AUTH_USER=admin
      - N8N_BASIC_AUTH_PASSWORD=secure-password
volumes:
  n8n_data:
Enter fullscreen mode Exit fullscreen mode

Workflow 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_email": "user@example.com"}}'

# Activate/deactivate
curl -X PATCH 'http://localhost:5678/api/v1/workflows/WORKFLOW_ID' \
  -H 'X-N8N-API-KEY: your-api-key' \
  -d '{"active": true}'
Enter fullscreen mode Exit fullscreen mode

Example: Lead Enrichment Workflow

1. Webhook receives new lead → {email, company}
2. HTTP node → Clearbit API → get company data
3. IF node → company size > 50 employees?
   YES → Add to Salesforce as "Enterprise Lead"
   NO → Add to Mailchimp "SMB" list
4. Slack notification → #sales channel
5. Google Sheets → log lead for reporting
Enter fullscreen mode Exit fullscreen mode

Code Node (When Visual Isn't Enough)

// JavaScript code node
const items = $input.all();

for (const item of items) {
  // Custom data transformation
  item.json.fullName = `${item.json.firstName} ${item.json.lastName}`;
  item.json.domain = item.json.email.split('@')[1];
  item.json.leadScore = calculateScore(item.json);
}

function calculateScore(lead) {
  let score = 0;
  if (lead.companySize > 100) score += 30;
  if (lead.industry === 'technology') score += 20;
  if (lead.title.includes('CTO')) score += 50;
  return score;
}

return items;
Enter fullscreen mode Exit fullscreen mode

AI Workflows

1. RSS Feed → new blog posts from competitors
2. AI Agent node (GPT-4) → "Summarize this article and extract key insights"
3. IF → sentiment analysis score > 0.7?
4. Notion → save summary to competitive intelligence database
5. Slack → notify product team about relevant competitor moves
Enter fullscreen mode Exit fullscreen mode

n8n vs Alternatives

Feature n8n Zapier Make Activepieces
Self-host Yes No No Yes
Free tier Unlimited (self) 100 tasks/mo 1K ops/mo Unlimited (self)
Code nodes JS/Python None None TypeScript
Integrations 400+ 6,000+ 1,500+ 200+
AI nodes Built-in AI addon AI addon Basic
Error handling Advanced Basic Good Basic
Complexity Any Simple Medium Simple

Real-World Impact

A marketing team paid $149/month for Zapier Pro (20K tasks). After migrating 15 workflows to self-hosted n8n on a $12/month VPS: unlimited executions, custom code nodes for data enrichment that Zapier could not do, and AI-powered content summarization. Saved $1,644/year and got more powerful automations.


Automating your business workflows? I help teams build and optimize automation pipelines. Contact spinov001@gmail.com or explore my data tools on Apify.

Top comments (0)