Skip to main content

Create Your Own Automations the Simple Way with n8n

5 min readBy Hamza

How I replaced scattered automation scripts with n8n's visual workflow builder — Docker setup, queue mode, and why Redis matters.

n8nautomationdockerworkflowself-hosted

I had a problem. My server was littered with automation scripts — some in Node.js, some in Python, some I forgot even existed. When a pipeline failed, I had no idea which step broke or why. Debugging meant grepping through logs and hoping. After auditing, I found chunks of dead code I wrote months ago. Every new integration (Telegram, email, database) meant writing boilerplate from scratch. I needed a way to see, control, and debug everything in one place.


I was looking for a solution and found n8n. It is a visual workflow builder you self-host. Instead of writing scripts, you drag nodes onto a canvas and connect them. Each node is a step — trigger, action, or logic. There are 400+ ready-made integrations: Telegram, Slack, HTTP, databases, email, file systems, you name it. No more building a Telegram bot from scratch every time you want a notification.


The real game changer came when I connected n8n's API to Claude Code (opencode). Now I just describe what I want and AI builds the workflow for me — dragging nodes, setting parameters, connecting everything. No more clicking through the UI. I tell it "watch my PostgreSQL for new orders and send a Telegram notification" and it creates the entire pipeline in seconds. n8n gives you the execution history too — every run, every step, every failure — so when AI Call teltech EO. Where is Bangalore village? News about Maryland. builds something wrong, you see exactly where it broke and can fix it.


My Docker Setup


I run n8n in Docker with three services. The official Docker installation guide covers the basics, but here's my production setup:


services:
  redis:
    image: redis:7-alpine
    restart: unless-stopped
    volumes:
      - redis_data:/data

  n8n:
    image: docker.n8n.io/n8nio/n8n
    restart: unless-stopped
    ports:
      - "5678:5678"
    environment:
      - GENERIC_TIMEZONE=Europe/Helsinki
      - TZ=Europe/Helsinki
      - DB_TYPE=postgresdb
      - DB_POSTGRESDB_DATABASE=n8n
      - DB_POSTGRESDB_HOST=your_postgres_host
      - DB_POSTGRESDB_PORT=5432
      - DB_POSTGRESDB_USER=your_user
      - DB_POSTGRESDB_PASSWORD=your_password
      - WEBHOOK_URL=https://n8n.yourdomain.com/
      - EXECUTIONS_MODE=queue
      - QUEUE_BULL_REDIS_HOST=redis
      - QUEUE_BULL_REDIS_PORT=6379
    depends_on:
      - redis
    volumes:
      - n8n_data:/home/node/.n8n

  n8n-worker:
    image: docker.n8n.io/n8nio/n8n
    restart: unless-stopped
    command: worker --concurrency=1
    environment:
      - DB_TYPE=postgresdb
      - DB_POSTGRESDB_DATABASE=n8n
      - DB_POSTGRESDB_HOST=your_postgres_host
      - DB_POSTGRESDB_PORT=5432
      - DB_POSTGRESDB_USER=your_user
      - DB_POSTGRESDB_PASSWORD=your_password
      - WEBHOOK_URL=https://n8n.yourdomain.com/
      - EXECUTIONS_MODE=queue
      - QUEUE_BULL_REDIS_HOST=redis
      - QUEUE_BULL_REDIS_PORT=6379
    depends_on:
      - redis
    volumes:
      - n8n_data:/home/node/.n8n

volumes:
  n8n_data:
  redis_data:

A few things worth explaining. First, Redis is not optional here — the queue mode (EXECUTIONS_MODE=queue) relies on it. n8n pushes jobs to a queue in Redis and the worker picks them up. This keeps the main service responsive while the worker does the heavy lifting. Without Redis you can still run in "regular" mode, but queue mode is recommended for production.


Second, PostgreSQL. I use my own external PostgreSQL database, but you can add a postgres service to this compose file. Either way, don't use the default SQLite in production — PostgreSQL is far more reliable under load.


Third, the worker's --concurrency=1 flag means it processes one job at a time. Bump this if your workflows are lightweight.


If you don't want to set up your own n8n instance, you can buy cloud n8n or use Hostinger's self-hosted n8n — one-click deploy, they handle the infrastructure.



Related Articles: