We use cookies to understand how the site is used and to display ads. Analytics and advertising only run after you accept. You can change your choice anytime. Privacy policy

Skip to content
devvkit
$devvkit learn --librarie n8n-guide

N8N Guide

[automation][low-code][workflow][integration]
Automation & CI/CD
Install
# Docker (easiest):
docker run -d --name n8n -p 5678:5678 \
  -v n8n_data:/home/node/.n8n \
  n8nio/n8n
# npm:
npx n8n
# Open: http://localhost:5678

N8N is the open-source alternative to Zapier/Make. Build workflows visually by connecting nodes: triggers (webhook, schedule, email) → actions (HTTP request, database query, Slack message, AI generation). Each node has a GUI for configuration with zero code.

N8N supports 400+ integrations: Slack, email (SMTP), Google Sheets, Notion, GitHub, Jira, PostgreSQL, MongoDB, OpenAI, Pinecone, and more. The HTTP Request node can call any REST/gRPC API. The Code node lets you write JavaScript/Python for custom logic.

Self-host N8N for sensitive data workflows. It supports queues with Redis for scaling, worker separation, and multi-user with roles. The execution log shows every step with input/output data for debugging. GUI is the primary interface: perfect for ops teams.

Setup

Start with Docker· Launch N8N server.
docker run -d --restart=always \
  --name n8n \
  -p 5678:5678 \
  -v n8n_data:/home/node/.n8n \
  -e N8N_SECURE_COOKIE=false \
  n8nio/n8n

# With basic auth:
  -e N8N_BASIC_AUTH_ACTIVE=true \
  -e N8N_BASIC_AUTH_USER=admin \
  -e N8N_BASIC_AUTH_PASSWORD=secret

# Open: http://localhost:5678
Install via npm· Direct install.
npm install n8n -g
n8n start
# Or:
npx n8n

# Configuration:
export N8N_PORT=5678
export DB_TYPE=postgresdb
export DB_POSTGRESDB_DATABASE=n8n
export DB_POSTGRESDB_USER=n8n
export DB_POSTGRESDB_PASSWORD=secret
n8n start

Core Nodes

HTTP Request node· Call any API.
# Node: HTTP Request
# Method: GET/POST/PUT/DELETE
# URL: https://api.example.com/users
# Authentication: Basic / OAuth2 / API Key / Header

# Parse JSON response:
# Response data is available in subsequent nodes as:
# {{ $json.body }}
# {{ $json.headers }}

# Pagination:
# Headers.Link parsing or loop over pages

Triggers

Webhook trigger· Start workflow from HTTP call.
# Add "Webhook" node
# Method: POST
# Path: my-webhook

# Then any service POSTs to:
# POST http://your-n8n:5678/webhook/my-webhook

# Example: GitHub webhook → save issue to Notion
# or: Stripe webhook → send Slack alert

# The webhook URL is auto-generated:
echo "Your URL: http://localhost:5678/webhook/$(openssl rand -hex 8)"
Schedule trigger· Run on a cron schedule.
# Add "Schedule Trigger" node
# Mode: Every Day / Every Hour / Custom
# Custom cron: */15 * * * * (every 15 min)
# Or: 0 6 * * 1-5 (weekdays at 6am)

# Common patterns:
# - Every hour: 0 * * * *
# - Every Monday 9am: 0 9 * * 1
# - First of month: 0 0 1 * *

AI Nodes

AI / LLM nodes· Integrate OpenAI, Claude, etc.
# Nodes:
# - OpenAI (Chat, Completion, Embedding, Image)
# - Anthropic Claude
# - Hugging Face Inference
# - LangChain (advanced chains)

# Example: Email → AI summarize → Slack
# 1. Email (IMAP) trigger
# 2. OpenAI node: summarize body text
# 3. Slack node: post summary to channel

Advanced

Error handling· Retry and error workflows.
# Each node has:
# - "Continue on Fail" toggle
# - "Error Workflow" (separate workflow that runs on error)
# - Retry on Fail (with backoff)

# Error workflow receives:
# { error: "...", workflow: { ... }, execution: { ... } }
# Use: send notification, log to database, create ticket
N8N CLI: import/export· Backup workflows.
# Export all workflows as JSON:
n8n export:workflow --all --output=./backups/

# Import:
n8n import:workflow --input=./backups/my-workflow.json

# Export credentials:
n8n export:credentials --all --output=./secrets/

# List workflows:
n8n list:workflow

# Start with specific workflows:
n8n start --tunnel  # Expose to internet via n8n tunnel