Antwa CodeAntwaCode Blog

Awesome Repo8 min read

n8n: Powerful Workflow Automation

n8n is a workflow automation platform with 400+ integrations and built-in AI.

Read in Bahasa Indonesia

n8n: Powerful Workflow Automation

n8n Image: GitHub

If you've ever found yourself stuck in a loop of copy-pasting data between apps, or bouncing between email, spreadsheets, and chat all day — you need workflow automation. And one of the best platforms you can use today is n8n.

With over 201,000 stars on GitHub (a Top 50 most popular project!), a 4.7/5 rating on G2, and a community of 200,000+ members, n8n has proven itself as the go-to choice for workflow automation. Let's dive in!


Table of Contents


What is n8n? {#what-is-n8n}

n8n (pronounced "n-eight-n" or "nodemation") is a fair-code workflow automation platform designed to help technical teams build, run, and manage cross-application automations.

In simple terms, n8n lets you connect various apps and services — like Google Sheets, Slack, GitHub, databases, custom APIs, and hundreds more — into a single visual workflow that runs automatically.

Here's what makes n8n stand out:

  • Fair-code with a Sustainable Use License — source code is always visible and modifiable
  • Self-hosted — your data stays on your own servers
  • Visual editor — drag and drop, but you can use code too
  • 400+ integrations (now 1500+ including custom nodes!)
  • AI-native — built-in support for AI agents, LangChain, and MCP

"n8n was the big unlock. Tools like ChatGPT and Claude are great, but n8n is the thing that allows you to integrate AI into your work and your processes in a safe and controlled way." — Ollie Scheers, CTO Huel


Brief History {#brief-history}

n8n was created by Jan Oberhauser and first released in 2019. The name "n8n" is short for "nodemation" — a combination of "node" (from Node-View and Node.js) and "-mation" (for automation).

As of 2026, n8n has grown into one of the most popular open source projects on GitHub:

MetricCount
GitHub Stars201,000+
Forks60,100+
Commits23,000+
Contributors1,000+
Integrations1500+
Community Members200,000+
G2 Rating4.7/5

n8n is also backed by solid investors and has a sustainable business model with n8n Cloud as its hosted offering.


1. Open Source & Self-Hosted

Unlike Zapier or Make (formerly Integromat), n8n can be self-hosted. You have full control over your data, no vendor lock-in, and you can customize it to your needs.

2. Visual + Code

Not everyone likes writing code. n8n offers an intuitive visual editor for building workflows, but still lets you write JavaScript or Python when you need more complex logic.

3. AI-First

n8n doesn't just "support AI" — it's built as an AI-native platform. You can:

  • Connect various AI models (OpenAI, Anthropic, Google, open-source models)
  • Build AI agents with traceable reasoning
  • Implement RAG (Retrieval-Augmented Generation) with ease
  • Use MCP (Model Context Protocol) for tool integration

4. Massive Ecosystem

With 1500+ integrations and 9,000+ workflow templates, nearly every popular app is covered. From Google Workspace to Salesforce, from GitHub to TikTok.

5. Enterprise-Ready

n8n isn't just for side projects. Enterprise features include:

  • SSO (SAML, LDAP)
  • RBAC (Role-Based Access Control)
  • Audit logs & log streaming to SIEM
  • Encrypted secret stores
  • Git-based version control for workflows

Key Features {#key-features}

Visual Workflow Editor {#visual-workflow-editor}

n8n uses a canvas-based approach for its visual editor. You can drag and drop nodes, connect them with connectors, and watch data flow through each step in real time.

Visual editor features:

  • Drag & drop nodes onto the canvas
  • Step-by-step testing — test a single node without running the entire workflow
  • Inline data preview — view data at each node directly on the canvas
  • Visual error handling — set up fallbacks and error handling right in the editor
  • Zoom & pan for complex workflows
[Trigger] → [HTTP Request] → [Transform Data] → [Send Email]
     ↓                              ↓
[Webhook]                    [Google Sheets]

The workflow above is a simple example: data comes in via webhook, gets transformed, then an email is sent while it's also saved to Google Sheets.

400+ Integrations {#integrations}

n8n currently has over 1500 integrations (including community-built custom nodes). Some popular categories:

Productivity:

  • Google Workspace (Gmail, Sheets, Drive, Calendar)
  • Microsoft 365 (Outlook, Excel, Teams)
  • Slack, Discord, Telegram
  • Notion, Airtable, Trello

Development:

  • GitHub, GitLab, Bitbucket
  • Jira, Linear, Asana
  • Docker, Kubernetes
  • PostgreSQL, MySQL, MongoDB, Redis

Marketing & Sales:

  • HubSpot, Salesforce, Pipedrive
  • Mailchimp, SendGrid, Postmark
  • Stripe, PayPal
  • Facebook Ads, Google Ads

AI & LLM:

  • OpenAI (GPT-4, GPT-4o, o1)
  • Anthropic (Claude 3.5, Claude 4)
  • Google Gemini
  • Ollama (for local models)
  • Pinecone, Qdrant (vector stores)

Example usage of the Google Sheets node:

// Example: Reading data from Google Sheets
// Node: Google Sheets → Read Rows
 
// Output will be an array of objects:
[
  {
    "Name": "John Smith",
    "Email": "john@example.com",
    "Status": "Active"
  },
  {
    "Name": "Jane Doe",
    "Email": "jane@example.com",
    "Status": "Pending"
  }
]

Native AI Capabilities {#ai-capabilities}

This is what sets n8n apart in 2026. n8n has built-in support for:

AI Agents:

// Workflow: AI Agent with tool usage
// 1. Trigger: Webhook (receives user message)
// 2. AI Agent node: 
//    - Model: OpenAI GPT-4o
//    - System Prompt: "You are a customer service assistant"
//    - Tools: HTTP Request, Google Sheets, Slack
// 3. Output: Send response to Slack
 
// Example JSON for AI Agent node:
{
  "model": "gpt-4o",
  "systemMessage": "You are a helpful customer service assistant. Use the available tools to answer customer questions.",
  "tools": ["httpRequest", "googleSheets", "slack"],
  "maxIterations": 5,
  "temperature": 0.7
}

RAG (Retrieval-Augmented Generation):

[Document Loader] → [Text Splitter] → [Vector Store] 

[Query] → [Retriever] → [AI Chain] → [Response]

MCP Support: n8n supports the Model Context Protocol (MCP) for connecting AI with tools and data sources using a standard interface.

Self-Hosted {#self-hosted}

n8n can easily run on your own server. This matters for:

  • Data privacy — sensitive data never needs to leave your infrastructure
  • Full control — customize, configure, and monitor as needed
  • Compliance — meet regulations like GDPR, HIPAA
  • Cost — at high volumes, self-hosted can be cheaper than cloud

Code When You Need It {#code-when-you-need-it}

n8n doesn't force you to use the visual editor exclusively. There's a Code Node that supports:

JavaScript:

// Code Node: Transform data with JavaScript
const items = $input.all();
 
const results = items.map(item => ({
  json: {
    ...item.json,
    fullName: `${item.json.firstName} ${item.json.lastName}`,
    emailDomain: item.json.email.split('@')[1],
    createdAt: new Date().toISOString()
  }
}));
 
return results;

Python (Experimental):

# Code Node (Python): Transform data
import json
 
items = $input.all()
results = []
 
for item in items:
    data = item['json']
    results.append({
        'json': {
            **data,
            'fullName': f"{data['firstName']} {data['lastName']}",
            'processedAt': datetime.now().isoformat()
        }
    })
 
return results

Docker Installation {#docker-installation}

The most popular way to run n8n is with Docker. Here's a complete guide:

Basic Installation

# 1. Create a Docker volume for persistent data
docker volume create n8n_data
 
# 2. Run n8n
docker run -it --rm \
  --name n8n \
  -p 5678:5678 \
  -v n8n_data:/home/node/.n8n \
  docker.n8n.io/n8nio/n8n

Then open your browser and go to http://localhost:5678. You'll see the n8n editor!

For production, it's better to use Docker Compose for more advanced configuration:

# docker-compose.yml
version: '3.8'
 
services:
  n8n:
    image: docker.n8n.io/n8nio/n8n
    restart: always
    ports:
      - "5678:5678"
    environment:
      # Basic configuration
      - N8N_HOST=localhost
      - N8N_PORT=5678
      - N8N_PROTOCOL=http
      - GENERIC_TIMEZONE=America/New_York
      - TZ=America/New_York
      
      # Database (use PostgreSQL for production)
      - DB_TYPE=postgresdb
      - DB_POSTGRESDB_HOST=postgres
      - DB_POSTGRESDB_PORT=5432
      - DB_POSTGRESDB_DATABASE=n8n
      - DB_POSTGRESDB_USER=n8n
      - DB_POSTGRESDB_PASSWORD=n8n_password_change_me
      
      # Security
      - N8N_BASIC_AUTH_ACTIVE=true
      - N8N_BASIC_AUTH_USER=admin
      - N8N_BASIC_AUTH_PASSWORD=your_secure_password
      
      # Webhook URL (for production)
      - WEBHOOK_URL=https://n8n.example.com/
      
      # Encryption key for credentials
      - N8N_ENCRYPTION_KEY=your-encryption-key-here
    volumes:
      - n8n_data:/home/node/.n8n
      - ./custom-nodes:/opt/custom-nodes
    depends_on:
      - postgres
 
  postgres:
    image: postgres:16-alpine
    restart: always
    environment:
      - POSTGRES_USER=n8n
      - POSTGRES_PASSWORD=n8n_password_change_me
      - POSTGRES_DB=n8n
    volumes:
      - postgres_data:/var/lib/postgresql/data
    ports:
      - "5432:5432"
 
volumes:
  n8n_data:
  postgres_data:

Run it with:

docker compose up -d

Key Environment Variables

# .env file for Docker Compose
 
# === Database ===
DB_TYPE=postgresdb
DB_POSTGRESDB_HOST=postgres
DB_POSTGRESDB_PORT=5432
DB_POSTGRESDB_DATABASE=n8n
DB_POSTGRESDB_USER=n8n
DB_POSTGRESDB_PASSWORD=your_secure_password
 
# === Security ===
N8N_BASIC_AUTH_ACTIVE=true
N8N_BASIC_AUTH_USER=admin
N8N_BASIC_AUTH_PASSWORD=your_secure_password
N8N_ENCRYPTION_KEY=generate_a_random_key_here
 
# === Execution ===
# Save all workflow executions
EXECUTIONS_DATA_SAVE_ON_SUCCESS=all
EXECUTIONS_DATA_SAVE_ON_ERROR=all
# Keep execution data for 7 days
EXECUTIONS_DATA_PRUNE=true
EXECUTIONS_DATA_MAX_AGE=10080
 
# === Webhook ===
WEBHOOK_URL=https://n8n.example.com/
 
# === Timezone ===
GENERIC_TIMEZONE=America/New_York
TZ=America/New_York

Quick Start via npx (Lightweight Alternative)

If you just want to try it out, you can use npx:

# Make sure Node.js 18+ is installed
node --version
 
# Run n8n directly
npx n8n

Custom Nodes

n8n supports custom nodes that you can build yourself:

# Custom node structure
my-custom-node/
├── package.json
├── credentials/
   └── MyApi.credentials.ts
├── nodes/
   └── MyCustomNode.node.ts
└── tsconfig.json
// nodes/MyCustomNode.node.ts
import {
  INodeType,
  INodeTypeDescription,
  IExecuteFunctions,
  INodeExecutionData,
} from 'n8n-workflow';
 
export class MyCustomNode implements INodeType {
  description: INodeTypeDescription = {
    displayName: 'My Custom Node',
    name: 'myCustomNode',
    group: ['transform'],
    version: 1,
    description: 'Custom node for specific needs',
    defaults: {
      name: 'My Custom Node',
    },
    inputs: ['main'],
    outputs: ['main'],
    credentials: [
      {
        name: 'myApi',
        required: true,
      },
    ],
    properties: [
      {
        displayName: 'Operation',
        name: 'operation',
        type: 'options',
        options: [
          {
            name: 'GetData',
            value: 'getData',
          },
        ],
        default: 'getData',
      },
    ],
  };
 
  async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
    const items = this.getInputData();
    const returnData: INodeExecutionData[] = [];
 
    for (let i = 0; i < items.length; i++) {
      // Your custom node logic goes here
      returnData.push({
        json: {
          ...items[i].json,
          customField: 'value from custom node',
        },
      });
    }
 
    return [returnData];
  }
}

Example Workflow: Webhook to Telegram {#example-workflow}

Let's build a simple workflow that receives data from a webhook and sends a notification to Telegram.

Steps:

1. Trigger Node (Webhook)

Type: Webhook
Method: POST
Path: /my-webhook

2. Set Node (Transform Data)

// Transform webhook data into the desired format
const data = $input.first().json;
 
return {
  json: {
    message: `📢 New Notification!\n\nFrom: ${data.from}\nMessage: ${data.message}\nTime: ${new Date().toLocaleString('en-US')}`,
    chatId: data.chatId
  }
};

3. Telegram Node (Send Message)

Type: Telegram
Operation: Send Message
Chat ID: {{ $json.chatId }}
Text: {{ $json.message }}

Workflow JSON (Import directly into n8n):

{
  "name": "Webhook to Telegram",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "my-webhook",
        "responseMode": "onReceived",
        "responseData": "allEntries"
      },
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 1,
      "position": [250, 300]
    },
    {
      "parameters": {
        "values": {
          "string": [
            {
              "name": "message",
              "value": "=📢 New Notification!\n\nFrom: {{ $json.body.from }}\nMessage: {{ $json.body.message }}\nTime: {{ $now.format('dd/MM/yyyy HH:mm') }}"
            }
          ]
        }
      },
      "name": "Set",
      "type": "n8n-nodes-base.set",
      "typeVersion": 1,
      "position": [450, 300]
    },
    {
      "parameters": {
        "chatId": "YOUR_TELEGRAM_CHAT_ID",
        "text": "={{ $json.message }}",
        "additionalFields": {}
      },
      "name": "Telegram",
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1,
      "position": [650, 300],
      "credentials": {
        "telegramApi": {
          "id": "YOUR_CREDENTIAL_ID",
          "name": "Telegram Bot"
        }
      }
    }
  ],
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "Set",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set": {
      "main": [
        [
          {
            "node": "Telegram",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

How to test:

# Send data to the webhook
curl -X POST http://localhost:5678/webhook/my-webhook \
  -H "Content-Type: application/json" \
  -d '{
    "from": "John",
    "message": "Hello, this is a message from the webhook!",
    "chatId": "YOUR_CHAT_ID"
  }'

Example Workflow: AI Chatbot with RAG {#example-workflow-ai}

This workflow demonstrates how to build an AI chatbot that answers questions based on your own documents (RAG).

Architecture:

[Webhook] → [Vector Store Retrieval] → [AI Agent] → [Response]
     ↑                                        ↓
[Prompt]                               [OpenAI Model]

                                      [Tools: Search]

Configuration:

1. Webhook Trigger

Method: POST
Path: /ai-chat
Body: { "question": "What is the company leave policy?" }

2. Pinecone Vector Store Node

// Query the vector store for relevant documents
const question = $input.first().json.body.question;
 
// n8n will automatically query Pinecone
// and return relevant document chunks

3. AI Agent Node

{
  "model": "gpt-4o",
  "systemMessage": "You are a company HR assistant. Answer questions based on the provided documents. If the information is not in the documents, say that you don't have that information.",
  "tools": ["pineconeVectorStore", "httpRequest"],
  "maxIterations": 3,
  "temperature": 0.3
}

4. Response to Webhook

Return the AI response as JSON

Pinecone Vector Store Implementation:

// Before using the RAG workflow,
// you need to index your documents into Pinecone first
 
// Additional workflow: Document Indexer
// Trigger: Manual (or scheduled)
 
const documents = [
  {
    text: "Annual leave policy: Every employee is entitled to 12 days of leave per year.",
    metadata: { category: "policy", source: "hr-handbook.pdf" }
  },
  {
    text: "Sick leave: Employees can take sick leave with a doctor's note.",
    metadata: { category: "policy", source: "hr-handbook.pdf" }
  },
  // ... other documents
];
 
// Save to Pinecone using the n8n Pinecone node
// or another supported vector store

Example Workflow: Email Monitoring & Auto-Reply {#example-workflow-email}

This workflow monitors incoming emails and automatically replies based on category.

Workflow:

[Email Trigger] → [Switch Node] → [Auto-Reply (Sales)]

              [Auto-Reply (Support)]

              [Auto-Reply (General)]

Configuration:

1. Email Trigger (IMAP)

{
  "mailbox": "INBOX",
  "options": {
    "forceReconnect": "everyMinute"
  }
}

2. Switch Node (Classification)

// Classify based on email subject
const subject = $input.first().json.subject.toLowerCase();
 
let category = 'general';
 
if (subject.includes('sale') || subject.includes('price') || subject.includes('demo')) {
  category = 'sales';
} else if (subject.includes('error') || subject.includes('bug') || subject.includes('help')) {
  category = 'support';
}
 
return { json: { ...$input.first().json, category } };

3. Auto-Reply Template

// Reply templates for each category
const templates = {
  sales: {
    subject: 'Re: {{ $json.subject }}',
    body: `Hello!
 
Thank you for reaching out. Our sales team will get back to you shortly.
 
For a quick reference, here's our demo link: https://example.com/demo
 
Best regards,
Sales Team`
  },
  support: {
    subject: 'Re: {{ $json.subject }}',
    body: `Hello!
 
We've received your report. Our support team will follow up within 24 hours.
 
In the meantime, you can check our FAQ at: https://example.com/faq
 
Best regards,
Support Team`
  },
  general: {
    subject: 'Re: {{ $json.subject }}',
    body: `Hello!
 
Thank you for reaching out. We've received your email and will process it shortly.
 
Best regards,
Our Team`
  }
};

Use Cases Across Teams {#use-cases}

🏢 IT Ops

  • Employee Onboarding: Automatically create Google Workspace, Slack, and GitHub accounts, and send a welcome email when a new hire joins
  • Server Monitoring: Monitor servers via API, send alerts to Slack/Telegram if issues arise
  • Backup Automation: Schedule automatic database backups to S3/Google Cloud Storage

🔒 SecOps

  • Threat Intelligence: Enrich security incident tickets with data from various threat intelligence feeds
  • Log Aggregation: Collect logs from multiple sources and analyze them with AI
  • Incident Response: Automatically create tickets, notify teams, and document security incidents

💻 DevOps

  • CI/CD Pipeline Enhancement: Trigger deployments, run tests, and notify the team on every change
  • Infrastructure as Code: Automatically provision infrastructure from form requests
  • Natural Language to API: Convert natural language instructions into API calls

📊 Sales & Marketing

  • Lead Scoring: Automatically score leads based on data from multiple sources
  • Customer Insights: Analyze customer reviews and generate insights with AI
  • Campaign Automation: Run multi-channel campaigns with personalization

📋 HR & Admin

  • Leave Management: Automate leave processing and notify managers
  • Document Generation: Create contracts, letters, and other documents automatically
  • Employee Onboarding Checklist: Automated checklist for new hires

🎯 Real-World Use Cases from Major Companies

Huel — Built an "AI-first company culture" and saved 1,000 hours of manual work.

Vodafone — Revolutionized threat intelligence and saved £2.2 million.

SAP — Uses n8n to automate various internal business processes.


n8n vs Competitors {#vs-competitors}

Featuren8nZapierMakePower Automate
Open Source✅ Fair-code
Self-Hosted
Visual Editor
Code Support✅ JS/PythonLimitedLimitedLimited
AI-Native⚠️ Basic⚠️ Basic⚠️ Basic
Integrations1500+7000+1800+1000+
PricingFree (self-host)From $20/moFrom $9/moFrom $15/mo
Community200K+---

n8n's strengths:

  • Free for self-hosted (no workflow/execution limits)
  • Full control over data and infrastructure
  • Better code support (JavaScript, Python, npm packages)
  • Deeper AI capabilities
  • No vendor lock-in

n8n's weaknesses:

  • Requires setup and maintenance (for self-hosted)
  • Steeper learning curve for beginners
  • Fewer community templates compared to Zapier

Tips & Best Practices {#tips}

1. Use Error Handling

// Add error handling at every critical workflow point
// Node: IF
// Condition: {{ $json.error }} exists
// True → send error notification
// False → continue workflow

2. Optimize Performance

// Use batching for operations involving large amounts of data
// Node: Split In Batches
// Batch Size: 50 (or adjust to match API limits)

3. Security Best Practices

# 1. Always use environment variables for credentials
# 2. Use a strong encryption key
# 3. Restrict access to the n8n editor
# 4. Use HTTPS for webhooks
# 5. Back up the database regularly

4. Monitoring & Observability

# Enable log streaming to SIEM
# Example: send logs to Elasticsearch
LOG_OUTPUT=console
EXECUTIONS_DATA_SAVE_ON_SUCCESS=all
EXECUTIONS_DATA_SAVE_ON_ERROR=all

5. Version Control for Workflows

# Export workflows as JSON and store them in Git
# n8n supports Git-based workflow management
# in the enterprise edition

Community & Resources {#resources}


Where to Start?

If you're using n8n for the first time, here are the recommended steps:

# 1. Install and run n8n
docker volume create n8n_data
docker run -it --rm \
  --name n8n \
  -p 5678:5678 \
  -v n8n_data:/home/node/.n8n \
  docker.n8n.io/n8nio/n8n
 
# 2. Open http://localhost:5678
# 3. Create an admin account
# 4. Import a workflow template from https://n8n.io/workflows
# 5. Explore and experiment!

Tips for beginners:

  • Start with existing workflow templates
  • Use "Test workflow" to debug step by step
  • Use the community forum if you get stuck
  • Read the docs for advanced features

Conclusion {#conclusion}

n8n is a powerful, flexible, and future-proof workflow automation platform. With an intuitive visual editor, comprehensive code support, AI-native capabilities, and a self-hosted option, n8n provides a complete solution for workflow automation in the AI era.

n8n is ideal for:

  • Developers who want workflow automation without limits
  • Teams that need full control over data and infrastructure
  • Companies looking to implement AI in their operations
  • Anyone tired of repetitive manual tasks

With 201,000+ stars on GitHub and an active community, n8n isn't just a tool — it's a growing ecosystem.

"Simple enough to see. Powerful enough to ship."

Start automating your workflows with n8n today! 🚀


Links:

More posts