Skip to content

n8n Workflow Automation Platform

n8n is our self-hosted workflow automation platform that connects various services and APIs.

Architecture

n8n runs as a Docker container behind Traefik reverse proxy with: - Internal port: 5678 - External access: HTTPS on port 443 via Traefik - Database: SQLite (default) with option for PostgreSQL - Networks: traefik_proxy (external), supabase_internal (database)

Configuration

Critical Environment Variables

N8N_WEBHOOK_BASE_URL=https://n8n.rbnk.uk:443  # MUST include :443 for Telegram
N8N_WEBHOOK_URL=https://n8n.rbnk.uk:443       # Explicit webhook URL
WEBHOOK_URL=https://n8n.rbnk.uk:443           # Legacy support

See docker-compose.yml for full configuration.

Common Operations

Service Management

# Start/Stop
docker compose up -d
docker compose down

# View logs
docker compose logs -f n8n

# Restart
docker compose restart n8n

Workflow Management

# Export all workflows
docker compose exec n8n n8n export:workflow --all --output=/files/workflows.json

# Import workflows
docker compose exec n8n n8n import:workflow --input=/files/workflows.json

Troubleshooting

Before debugging, always check: 1. troubleshooting.md - Quick troubleshooting guide 2. N8N_LEARNINGS.md - Detailed solutions

Most Common Issues

  1. Telegram webhook port error: Set webhook URLs with explicit :443
  2. 502 Bad Gateway: Wait 30 seconds after restart
  3. Workflow stops after webhook: Check credential IDs and responseMode
  4. Credential errors: Use ID from URL, not credential name

Integrations

Currently Active

  • Telegram Bot: AI assistant and task automation
  • Supabase: Database for task tracking
  • Slack: Notification system (being migrated to ntfy)
  • Cloudflare: DNS and security management
  • Prometheus: Metrics collection
  • Rclone: Backup automation

Available Nodes

  • 500+ built-in nodes
  • Custom code execution (JavaScript/Python)
  • Webhook triggers and HTTP requests
  • Database operations (PostgreSQL, MySQL, MongoDB)
  • File operations and data transformation

Workflows

Production Workflows

  1. Error Notification - Centralized error handling
  2. Task Status Checker - Query task status
  3. Task Completion Handler - Process completed tasks
  4. Infrastructure Monitor - System health checks
  5. Backup Automation - Scheduled backup operations
  6. Security Auditor - Regular security scans

Development Guidelines

  1. Always set responseMode: lastNode for webhooks
  2. Use exact credential IDs from UI
  3. Test with cURL before production
  4. Export workflows before major changes
  5. Use meaningful webhook paths

Security

  • All webhooks require HTTPS
  • Credentials encrypted at rest
  • Basic auth available for editor access
  • Network isolation via Docker networks
  • Regular security updates

Monitoring

  • Health endpoint: https://n8n.rbnk.uk/healthz
  • Prometheus metrics available
  • Execution history in UI
  • Error workflows for automated alerts

Resources