Introduction

  • TL;DR: n8n is a workflow automation platform where you connect nodes starting from a trigger (schedule/webhook/event) and pass JSON “items” through the workflow.
  • You’ll move fastest by learning (1) the items data model, (2) expressions like {{ $json... }}, and (3) operational basics: encryption key, webhook URL behind a proxy, and execution data retention.

Core Concepts You Must Know

Items and data flow

n8n passes data between nodes as an array of JSON objects called items. Most nodes run once per item.

Expressions ({{ ... }})

Expressions let you reference runtime data in node parameters. $json is shorthand for the incoming JSON of the current item, and $input helps you access node input.

Why it matters: Once you think in “items + expressions,” you can build 80% of real automations without custom services.

Getting Started: Docker + Persistent Storage

A common baseline: n8n + Postgres

Official docs provide Docker installation guidance and highlight typical self-hosting considerations.

Minimal compose concept:

  • Persist /home/node/.n8n
  • Use Postgres for production stability
  • Set N8N_ENCRYPTION_KEY explicitly (don’t rely on auto-generated keys)

Why it matters: Losing or changing your encryption key can break credential decryption and cause painful recoveries.

Webhooks Behind a Reverse Proxy: Set WEBHOOK_URL

When running behind a reverse proxy, n8n’s internal host/port don’t match the public URL. Docs recommend setting WEBHOOK_URL and proper proxy headers to ensure correct webhook registration and display.

Why it matters: Many “webhook shows localhost:5678” issues are simply missing WEBHOOK_URL.

Build Two Workflows (Practical Patterns)

Pattern 1: Schedule → HTTP Request → IF → Notify

This is the baseline for monitoring and reporting automations.

Pattern 2: Webhook → Validate → Store

Use the Webhook node to receive events, and a Code node for custom validation/transformations.

Why it matters: With schedule + webhook triggers, you cover most automation scenarios.

Error Handling: Treat Failures as First-Class

n8n supports error workflows using the Error Trigger node, and you can intentionally fail with Stop And Error to route into that error workflow.

Why it matters: Production automation is mostly about reliable failure reporting and fast diagnosis.

Scaling with Queue Mode (Redis + Workers)

n8n documents queue mode for scaling executions by separating the main process from workers using Redis. It also mentions optional webhook processors for webhook scaling. In queue mode, ensure all workers share the same N8N_ENCRYPTION_KEY.

Why it matters: When throughput grows, scaling becomes an architecture question (queue/workers), not just “bigger server.”

Backup & Migration: Use CLI Exports

The CLI supports exporting workflows and credentials, including a --decrypted option (handle carefully). Workflow export/import is also documented in the workflows guide.

Why it matters: Backups turn “inevitable incidents” into recoverable events.

License Note: Fair-code and Sustainable Use License

n8n documents the Sustainable Use License (SUL) as a fair-code license model introduced in 2022.

Why it matters: Commercial usage constraints may apply—confirm your usage model early.

Conclusion

  • Learn “items + expressions” first for rapid workflow building.
  • For self-hosting, lock down N8N_ENCRYPTION_KEY, set WEBHOOK_URL behind proxies, and manage execution data growth.
  • Scale with Redis-backed queue mode and workers when execution volume grows.
  • Use CLI exports for repeatable backup/migration processes.

Summary

  • Understand items (array of JSON objects)
  • Master expressions ({{ $json... }} and $input)
  • Secure & operate: encryption key, webhook URL, execution retention
  • Scale via queue mode (Redis + workers)

#n8n #workflowautomation #automation #devops #docker #webhook #selfhosting #postgres #redis #queueMode

References

  • (Docker Installation, 2026-01-05)[https://docs.n8n.io/hosting/installation/docker/]
  • (Expressions, 2026-01-05)[https://docs.n8n.io/code/expressions/]
  • (Current node input, 2026-01-05)[https://docs.n8n.io/code/builtin/current-node-input/]
  • (Understanding the data structure, 2026-01-05)[https://docs.n8n.io/courses/level-two/chapter-1/]
  • (Set a custom encryption key, 2026-01-05)[https://docs.n8n.io/hosting/configuration/configuration-examples/encryption-key/]
  • (Configure n8n webhooks with reverse proxy, 2026-01-05)[https://docs.n8n.io/hosting/configuration/configuration-examples/webhook-url/]
  • (Configuring queue mode, 2026-01-05)[https://docs.n8n.io/hosting/scaling/queue-mode/]
  • (Executions environment variables, 2026-01-05)[https://docs.n8n.io/hosting/configuration/environment-variables/executions/]
  • (CLI commands, 2026-01-05)[https://docs.n8n.io/hosting/cli-commands/]
  • (Sustainable Use License, 2026-01-05)[https://docs.n8n.io/sustainable-use-license/]
  • (Announcing the new Sustainable Use License, 2022-03-17)[https://blog.n8n.io/announcing-new-sustainable-use-license/]
  • (Configure self-hosted n8n for user management, 2026-01-05)[https://docs.n8n.io/hosting/configuration/user-management-self-hosted/]
  • (Using the Code node, 2026-01-05)[https://docs.n8n.io/code/code-node/]
  • (Error handling, 2026-01-05)[https://docs.n8n.io/flow-logic/error-handling/]
  • (Error Trigger node, 2026-01-05)[https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.errortrigger/]
  • (Stop And Error node, 2026-01-05)[https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.stopanderror/]
  • (Export and import workflows, 2026-01-05)[https://docs.n8n.io/workflows/export-import/]
  • (Execution data, 2026-01-05)[https://docs.n8n.io/hosting/scaling/execution-data/]
  • (Credentials could not be decrypted Issue, 2026-01-05)[https://github.com/n8n-io/n8n/issues/12949]