n8n Architecture Diagram: AI Workflow Automation & Self-Hosted Integration Patterns (2026)
How to diagram n8n architectures. Covers n8n self-hosted deployment, queue mode, AI agent nodes, LLM integrations, webhook triggers, and enterprise workflow automation patterns — with prompt templates to generate diagrams in seconds.
An n8n architecture diagram visualizes how an n8n workflow automation deployment is structured — from the n8n server instance and its backing services to the external systems it integrates, the AI nodes it orchestrates, and the trigger mechanisms that initiate workflows. n8n has become one of the most popular open-source workflow automation platforms for teams who need the power of Zapier-style automation with full data sovereignty, self-hosting, and native AI capabilities including LangChain integration and AI Agent nodes.
As organizations use n8n to automate increasingly complex AI workflows — from LLM-powered document processing to multi-step agentic research pipelines — diagramming the n8n architecture becomes essential for infrastructure planning, scaling decisions, debugging integration failures, and onboarding engineers who need to understand how automation pipelines are structured.
Core n8n components
n8n main process
The n8n main process is the central service responsible for workflow management, the web editor UI, webhook registration, and — in the default single-instance mode — workflow execution. It exposes a REST API for workflow CRUD operations, execution management, and credential management. In production architectures, the main process is separated from execution workers to prevent the UI from being affected by long-running workflow executions.
n8n workers (queue mode)
n8n's queue mode separates workflow execution from the main process. Workers pick up execution jobs from a Redis-backed message queue and run them independently. This enables horizontal scaling: you can run multiple workers to handle concurrent workflow executions without overloading the main n8n process. Queue mode is essential for production deployments with high execution volume or long-running AI workflows.
Backing services
Every n8n deployment requires two backing services:
- Database: Stores workflows, credentials, execution history, and user accounts. Supports PostgreSQL (recommended for production) and SQLite (for development or single-user setups). Show the database connection and whether it's managed (RDS, Cloud SQL) or self-hosted.
- Redis (queue mode only): Acts as the message broker between the main process and workers. Stores pending execution jobs and execution metadata. Show Redis as a separate box with the queue channel annotations.
Trigger mechanisms
n8n workflows can be triggered in multiple ways, each requiring different architecture components:
- Webhook triggers: n8n registers a public webhook URL that external services call. A reverse proxy (nginx, Caddy, Cloudflare Tunnel) sits in front to handle TLS and route requests to n8n.
- Schedule triggers: n8n's internal cron scheduler fires workflows on a time-based schedule. No external dependencies; show the schedule annotation on the trigger node.
- Polling triggers: n8n periodically polls external services (email, Slack, databases) for new events. Show the poll interval and the external service being polled.
- Manual / API triggers: Workflows started via the n8n UI, REST API, or another workflow calling the "Execute Workflow" node.
n8n AI agent architecture
n8n's AI Agent node (available since v1.0) turns n8n into an LLM orchestration layer. The AI Agent node wraps a chat model with a ReAct-style reasoning loop — the model receives the user's task, decides which tools to call, calls them, inspects the results, and iterates until it can produce a final answer. The tools available to the agent are defined as sub-nodes connected to the AI Agent node in the n8n canvas.
Key AI nodes in n8n's architecture:
- AI Agent node: The orchestrator — takes a chat model and a set of tools, runs the ReAct loop.
- Chat Model nodes: OpenAI Chat Model, Anthropic Chat Model, Ollama Chat Model, Google Gemini Chat Model — connects a specific LLM provider to the agent.
- Memory nodes: Window Buffer Memory (in-memory conversation history), Redis Chat Memory (persistent), Postgres Chat Memory — connects conversation history storage to the agent.
- Tool nodes: Any n8n node can become an agent tool — HTTP Request (call external APIs), Postgres (query databases), Code (run JavaScript/Python), Wikipedia, Calculator, SerpAPI.
- Vector Store nodes: Pinecone, Qdrant, Supabase Vector, Weaviate — connects a vector database for RAG-style knowledge retrieval.
- Embeddings nodes: OpenAI Embeddings, Cohere Embeddings — generates vector embeddings for documents inserted into the vector store.
Prompt templates for n8n architecture diagrams
Self-hosted n8n with queue mode
n8n AI agent workflow with RAG
n8n document processing pipeline
n8n deployment topology reference
| Deployment mode | Components | Best for |
|---|---|---|
| Single instance | n8n + SQLite | Development, personal use, low-volume automation |
| Single instance + Postgres | n8n + Postgres | Small teams, production with <100 executions/day |
| Queue mode | n8n main + N workers + Redis + Postgres | High-volume, long-running workflows, production |
| Multi-main (HA) | Multiple n8n main + N workers + Redis + Postgres + Load Balancer | Enterprise, zero-downtime deployments, high availability |
| n8n Cloud | Managed (no self-hosted components) | Teams without ops capacity; no data sovereignty needs |
Frequently asked questions about n8n architecture
What is an n8n architecture diagram?
An n8n architecture diagram shows the infrastructure components of an n8n deployment — the n8n main server, execution workers, Redis queue, PostgreSQL database, reverse proxy, and credential storage — along with the external systems n8n integrates (APIs, databases, SaaS tools) and the AI components it orchestrates (LLM providers, vector databases, embedding models). It is the primary documentation artifact for teams running n8n in production.
When should I use n8n queue mode?
Use n8n queue mode when you have more than ~20 concurrent workflow executions, long-running workflows (over 30 seconds), AI workflows that make multiple sequential LLM calls, or any production use case where you need the n8n UI to remain responsive regardless of execution load. Queue mode adds operational complexity (Redis dependency, worker management) but is essential for reliable production deployments.
How does n8n compare to other AI workflow orchestration tools?
n8n occupies a unique position: it provides no-code/low-code workflow automation (like Zapier) with full self-hosting, code nodes, and deep AI integration including LangChain-based AI Agent nodes and vector store integrations. Compared to LangChain or LlamaIndex (pure-code frameworks), n8n offers a visual canvas that non-engineers can use. Compared to Zapier or Make.com, n8n offers self-hosting, better developer customization, and native AI agent capabilities. For teams that need both business process automation and AI workflow orchestration in one platform, n8n is a strong choice.
Related guides: AI agent architecture diagrams, RAG architecture diagrams, LangGraph architecture diagrams, and event-driven architecture.
Ready to try it yourself?
Start Creating - Free