Back to blog

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.

R
Ryan·Senior AI Engineer
·

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

"A self-hosted n8n deployment on AWS ECS. Components: one n8n main container (handles UI, API, and webhook registration), three n8n worker containers (pick up execution jobs from the queue), one Redis ElastiCache instance (message broker for the queue), one RDS PostgreSQL database (workflow and credential storage). External traffic enters through an Application Load Balancer, which routes webhook requests and UI traffic to the n8n main container. Workers have no public exposure. The main container and workers share the same n8n Docker image but start with different N8N_PROCESS_ALL_WORKFLOWS flags. All containers are in a VPC private subnet. Credentials are stored in AWS Secrets Manager and injected via environment variables."

n8n AI agent workflow with RAG

"An n8n AI agent workflow for internal knowledge base Q&A. Trigger: Slack slash command sends a webhook to n8n. The AI Agent node uses Claude claude-sonnet-4-6 via the Anthropic Chat Model node with Window Buffer Memory (last 5 turns). The agent has three tools: (1) a Vector Store Retrieval tool connected to a Qdrant vector store containing company docs (embedded with OpenAI text-embedding-3-small), (2) an HTTP Request tool that calls the internal HR API, and (3) a Code tool that runs JavaScript for date/math calculations. The agent's final response is posted back to Slack via the Slack node. Execution history is stored in Postgres. Failed executions trigger a PagerDuty alert via the n8n error workflow."

n8n document processing pipeline

"An n8n document intake and summarization pipeline. Trigger: Gmail node polls every 5 minutes for emails with PDF attachments. Binary data (the PDF) is extracted and sent to the n8n Extraction node which calls the PDF.co API to convert to text. The text is chunked using the Recursive Text Splitter node (chunk size 1000, overlap 100) and sent to the OpenAI Embeddings node (text-embedding-3-small). Chunks and embeddings are upserted to Supabase's pgvector table. A summary is generated using the Summarization Chain node with GPT-4o mini. The summary plus a link to the original document is stored in a Notion database via the Notion node and a Slack notification is sent to the #document-inbox channel."

n8n deployment topology reference

Deployment modeComponentsBest for
Single instancen8n + SQLiteDevelopment, personal use, low-volume automation
Single instance + Postgresn8n + PostgresSmall teams, production with <100 executions/day
Queue moden8n main + N workers + Redis + PostgresHigh-volume, long-running workflows, production
Multi-main (HA)Multiple n8n main + N workers + Redis + Postgres + Load BalancerEnterprise, zero-downtime deployments, high availability
n8n CloudManaged (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