Skip to content
STACK IT FAST

n8n

Curated OSSHybridFair-Code Workflow Automation & AI Integrator20+ people

Audited from github.com/n8n-io/n8n

n8n is a fair-code workflow automation and AI agent platform built as a TypeScript and Vue pnpm monorepo, combining a visual editor with custom-code nodes, LangChain-based AI nodes, and Model Context Protocol support.

Language
TypeScript
Database
SQLite
Hosting
Docker
Running for
5 years
Team
20+ people

Why this architecture

n8n splits its execution engine, workflow schema, and integration nodes into separate TypeORM- and Express-backed packages so the automation runtime, node library, and Vue editor can be built, tested, and versioned independently inside one Turborepo-orchestrated pnpm workspace.

Tech stack by layer

9 technologies · audited Sep 17, 2026
Frontend & UI
  • VueRenders the workflow editor canvas and node panels in packages/frontend/editor-ui.
  • ViteBuilds the editor UI and the design-system and chat frontend packages.
Backend & APIs
  • Node.jsRuntime for the CLI server, workers, and the newer engine service (engines >=24).
  • ExpressHTTP server for the @n8n/engine workflow execution service.
  • TypeORMORM (as the @n8n/typeorm fork) mapping workflows, credentials, and executions to the database.
Data & Persistence
  • SQLiteZero-config default database; the sqlite3 native module is compiled into the production Docker image.
  • PostgreSQLProduction database option, wired through the pg driver in the engine package.
Infrastructure & Deploy
  • DockerShips as multi-stage Alpine images with a separate native-module compile stage.
  • TurborepoOrchestrates build, dev, and test tasks across the pnpm workspace packages.
  • pnpmWorkspace and dependency manager for the monorepo, with a shared version catalog.
Tooling, Testing & Ops
  • LangChainBacks the AI agent and LLM nodes via @langchain/core in the core execution package.
  • Model Context ProtocolImplemented by the mcp-apps package for MCP server and client node support.

n8n architecture diagram

Open SVG
n8n architecture diagramWorkflow editor → n8n server (REST); Triggers → n8n server (webhooks); Chat widget → n8n server (chat API); n8n server → @n8n/engine (execute); @n8n/engine → Nodes (run nodes); n8n server → Database (TypeORM); @n8n/engine → Database (pg); Nodes → Integrations (calls)CLIENTSSERVICESWORKERS & JOBSDATA & STORAGEEXTERNALWorkflow editorVue · ViteTriggerswebhooks · schedulesChat widgetVue packagen8n serverNode.js · CLI@n8n/engineExpress · TypeORMNodesnodes-base · AI nodesDatabaseSQLite / PostgreSQLIntegrationsAPIs · LLMs · MCPexecuteRESTwebhookschat APIrun nodesTypeORMpgcalls
How the main components of n8n connect, drawn from the audited repository.
Diagram as text
  • Workflow editor (Vue · Vite) → n8n server (Node.js · CLI): REST
  • Triggers (webhooks · schedules) → n8n server (Node.js · CLI): webhooks
  • Chat widget (Vue package) → n8n server (Node.js · CLI): chat API
  • n8n server (Node.js · CLI) → @n8n/engine (Express · TypeORM): execute
  • @n8n/engine (Express · TypeORM) → Nodes (nodes-base · AI nodes): run nodes
  • n8n server (Node.js · CLI) → Database (SQLite / PostgreSQL): TypeORM
  • @n8n/engine (Express · TypeORM) → Database (SQLite / PostgreSQL): pg
  • Nodes (nodes-base · AI nodes) → Integrations (APIs · LLMs · MCP): calls

Key architectural decisions

6 decisions
  1. 01

    Monorepo split into workflow, core, cli, and nodes-base packages

    The pnpm workspace (pnpm-workspace.yaml) separates packages/workflow (schema and expression engine), packages/core (execution primitives), packages/cli (the n8n server), and packages/nodes-base (integration nodes), letting each evolve and ship independently while Turborepo (turbo.json) coordinates builds.

  2. 02

    A newer engine package runs on Express, TypeORM, and Postgres directly

    packages/@n8n/engine/package.json declares express, @n8n/typeorm, and pg as direct dependencies alongside a testcontainers-postgresql devDependency, marking a v2 execution engine that is more tightly coupled to Postgres than the original packages/cli server.

  3. 03

    SQLite is the zero-config default; Postgres is the production path

    packages/cli test scripts default to DB_TYPE=sqlite, and docker/images/n8n/Dockerfile compiles the sqlite3 native addon into the runtime image so a single container works out of the box, while the engine package ships a pg driver for teams that need a shared production database.

  4. 04

    LangChain and MCP packages implement the AI-native workflow nodes

    packages/core/package.json depends on @langchain/core for LLM and agent nodes, and packages/@n8n/mcp-apps/package.json implements Model Context Protocol server and UI resources, matching the mcp, mcp-client, and mcp-server topics on the repository.

  5. 05

    Native modules are recompiled in a dedicated Docker build stage

    docker/images/n8n/Dockerfile adds a toolchain stage that installs python3, make, and g++ to rebuild isolated-vm and sqlite3 native addons before copying only the compiled output into the slim runtime image built from docker/images/n8n-base/Dockerfile.

  6. 06

    Design system and chat widget ship as independent Vue packages

    packages/frontend/@n8n/design-system/package.json and packages/frontend/@n8n/chat/package.json are separate Vue 3 and Vite packages built and versioned on their own, so the chat widget can be embedded outside the main editor-ui bundle.

How n8n is built

How n8n is structured

n8n is organized as a pnpm workspace defined in pnpm-workspace.yaml, with packages under packages/*, packages/@n8n/*, packages/frontend/**, packages/modules/**, and packages/extensions/**. Task orchestration across the workspace runs through Turborepo, configured in turbo.json. The repository separates concerns into a handful of core packages: packages/workflow holds the workflow schema and expression engine, packages/core implements execution primitives, packages/cli is the traditional n8n server (published to npm as n8n), packages/nodes-base bundles the built-in integration nodes, and packages/frontend/editor-ui is the Vue-based visual editor. A newer packages/@n8n/engine package represents a second execution engine built more directly on Express, TypeORM, and PostgreSQL.

Frontend

The primary UI, packages/frontend/editor-ui (published as n8n-editor-ui), is a Vue 3 application built with Vite (vite build in its build script) and type-checked with vue-tsc. It depends on the workspace's own @n8n/design-system package (packages/frontend/@n8n/design-system), which is itself a Vue 3 component library built independently with Vite and Storybook for isolated component development. A separate embeddable widget, @n8n/chat (packages/frontend/@n8n/chat), packages a standalone chat UI with its own Vite build targets (ES module and UMD bundles) so it can be dropped into third-party sites without pulling in the full editor.

Backend & APIs

The historical server lives in packages/cli, compiled with tsc and run as the n8n binary. Its test scripts default to DB_TYPE=sqlite, reflecting SQLite as the zero-friction local database. Alongside it, packages/@n8n/engine (n8n workflow execution engine (v2)) is a newer service with express, @n8n/typeorm, and pg listed as direct dependencies and @testcontainers/postgresql as a dev dependency, indicating this engine is developed and tested against a real PostgreSQL instance rather than only SQLite. Business logic for nodes lives in packages/nodes-base, which declares hundreds of credential and node files under its n8n.credentials and n8n.nodes manifest keys. AI-specific capability comes from packages/core, which lists @langchain/core as a dependency, and from packages/@n8n/mcp-apps, which implements Model Context Protocol server and UI-resource support (@modelcontextprotocol/sdk, @modelcontextprotocol/ext-apps) — consistent with the mcp, mcp-client, and mcp-server topics on the GitHub repository.

Data & persistence

n8n supports SQLite out of the box: docker/images/n8n/Dockerfile compiles the sqlite3 native addon in a dedicated native-builder stage (copying resolved pnpm symlink paths for sqlite3, node-addon-api, and tar) before the runtime stage. For PostgreSQL, the @n8n/engine package pulls in pg directly, and its ORM layer is @n8n/typeorm, an in-house fork of TypeORM referenced as a workspace dependency across the engine and CLI packages. This dual-database support is exercised in CI: the workspace's minimumReleaseAgeExclude and testcontainers setup show Postgres-backed integration testing alongside the SQLite-based unit test defaults.

Build, test & deploy

Builds run through turbo run build, with individual packages compiling via tsc (and tsc-alias for path rewriting) or, for packages/nodes-base, a tsc --build step followed by static-asset and metadata generation scripts. Linting mixes oxlint (fast, type-aware checks) with eslint for stricter "guardrail" rules, and formatting is handled by biome format. Unit and integration tests run on Vitest across most packages (packages/core, packages/workflow, packages/@n8n/engine) with a shared @n8n/vitest-config. Container images are produced by scripts/dockerize-n8n.mjs and the Dockerfiles under docker/images/, and docker/images/n8n-base/Dockerfile pins a specific node:24.19.0-alpine3.24 variant (referred to as a DHI reference) with fonts, tini, and librdkafka preinstalled for the runtime layer.

Self-hosting notes

The published Docker images (docker/images/n8n/Dockerfile) build on the shared base image and separate the native-module compilation (which needs a C/C++ toolchain) from the final runtime, keeping the shipped image slim. A minimal quick-start uses docker run directly against a persisted n8n_data volume, as documented in the project README. Because the engine package now depends on pg and @n8n/typeorm directly, self-hosters who need horizontal scaling or shared state across multiple n8n instances have a documented path to PostgreSQL rather than the SQLite default, without switching frameworks.

Sources & repo audit

Audited
Sep 17, 2026
Commit
77cd72c
License
NOASSERTION

Independent analysis of repository at github.com/n8n-io/n8n. Spotted an inaccuracy? Use the claim form to request a correction.

Show this stack on your README or website
Tech stack of n8n
[![Tech stack of n8n on STACK IT FAST](https://stackitfast.com/badge/n8n.svg)](https://stackitfast.com/project/n8n)

Paste it into your README. It shows your current stack and links to this page.

Use this stack

Scaffold it with your agent

Paste this prompt into Claude Code, Cursor, Windsurf or AGY to start a project with n8n's architecture.

  1. 1Copy the promptThe full markdown spec, with every layer and decision.
  2. 2Open your AI toolClaude Code, Cursor, Windsurf or Copilot, in a new repo.
  3. 3Paste and scaffoldUse it as the first instruction; review before you ship.
use-this-stack.md · 61 lines · 7.3 KB
# MISSION: Scaffold "n8n" Production Architecture
You are an expert Senior Staff Software Architect and Full-Stack Engineer. Your mission is to scaffold and implement a production-grade, highly reliable, and modular codebase following the proven architecture of **n8n**.
---
## 1. PROJECT SPECIFICATIONS & BENCHMARK
- **Reference Architecture**: n8n
- **What It Does**: n8n is a fair-code workflow automation and AI agent platform built as a TypeScript and Vue pnpm monorepo, combining a visual editor with custom-code nodes, LangChain-based AI nodes, and Model Context Protocol support.
- **Domain & Category**: Fair-Code Workflow Automation & AI Integrator
- **Production Scale**: 20+ people
- **Development Mode**: HYBRID
- **Architectural Rationale**: n8n splits its execution engine, workflow schema, and integration nodes into separate TypeORM- and Express-backed packages so the automation runtime, node library, and Vue editor can be built, tested, and versioned independently inside one Turborepo-orchestrated pnpm workspace.
- **Live Website Reference**: https://n8n.io
- **Source Repository**: https://github.com/n8n-io/n8n
---
## 2. PRODUCTION TECH STACK
- **Full Stack Array**: TypeScript, Vue, Node.js, PostgreSQL, SQLite, TypeORM, LangChain, Docker, Turborepo
- **Primary Language(s)**: TypeScript, Vue, JavaScript
- **License of the reference repo**: NOASSERTION
- **Frontend**: Vue — Renders the workflow editor canvas and node panels in packages/frontend/editor-ui.; Vite — Builds the editor UI and the design-system and chat frontend packages.
- **Backend & APIs**: Node.js — Runtime for the CLI server, workers, and the newer engine service (engines >=24).; Express — HTTP server for the @n8n/engine workflow execution service.; TypeORM — ORM (as the @n8n/typeorm fork) mapping workflows, credentials, and executions to the database.
- **Data & persistence**: SQLite — Zero-config default database; the sqlite3 native module is compiled into the production Docker image.; PostgreSQL — Production database option, wired through the pg driver in the engine package.
- **Infrastructure & deploy**: Docker — Ships as multi-stage Alpine images with a separate native-module compile stage.; Turborepo — Orchestrates build, dev, and test tasks across the pnpm workspace packages.; pnpm — Workspace and dependency manager for the monorepo, with a shared version catalog.
- **Tooling, testing & ops**: LangChain — Backs the AI agent and LLM nodes via @langchain/core in the core execution package.; Model Context Protocol — Implemented by the mcp-apps package for MCP server and client node support.
---
## 3. KEY ARCHITECTURAL DECISIONS (audited from https://github.com/n8n-io/n8n @ 77cd72c)
1. **Monorepo split into workflow, core, cli, and nodes-base packages**: The pnpm workspace (pnpm-workspace.yaml) separates packages/workflow (schema and expression engine), packages/core (execution primitives), packages/cli (the n8n server), and packages/nodes-base (integration nodes), letting each evolve and ship independently while Turborepo (turbo.json) coordinates builds.
2. **A newer engine package runs on Express, TypeORM, and Postgres directly**: packages/@n8n/engine/package.json declares express, @n8n/typeorm, and pg as direct dependencies alongside a testcontainers-postgresql devDependency, marking a v2 execution engine that is more tightly coupled to Postgres than the original packages/cli server.
3. **SQLite is the zero-config default; Postgres is the production path**: packages/cli test scripts default to DB_TYPE=sqlite, and docker/images/n8n/Dockerfile compiles the sqlite3 native addon into the runtime image so a single container works out of the box, while the engine package ships a pg driver for teams that need a shared production database.
4. **LangChain and MCP packages implement the AI-native workflow nodes**: packages/core/package.json depends on @langchain/core for LLM and agent nodes, and packages/@n8n/mcp-apps/package.json implements Model Context Protocol server and UI resources, matching the mcp, mcp-client, and mcp-server topics on the repository.
5. **Native modules are recompiled in a dedicated Docker build stage**: docker/images/n8n/Dockerfile adds a toolchain stage that installs python3, make, and g++ to rebuild isolated-vm and sqlite3 native addons before copying only the compiled output into the slim runtime image built from docker/images/n8n-base/Dockerfile.
6. **Design system and chat widget ship as independent Vue packages**: packages/frontend/@n8n/design-system/package.json and packages/frontend/@n8n/chat/package.json are separate Vue 3 and Vite packages built and versioned on their own, so the chat widget can be embedded outside the main editor-ui bundle.
---
## 4. NON-NEGOTIABLE ARCHITECTURAL GUARDRAILS
1. **Monorepo & Modular Separation**:
   - Structure as a Turborepo monorepo with strict package boundaries:
     - `apps/web`: Application UI, routing, layouts, and server endpoints.
     - `packages/ui`: Shared design tokens, CSS variables, and Radix UI primitive components.
     - `packages/db`: Database schemas, client singleton, declarative migrations, and seed scripts.
     - `packages/config`: Shared TypeScript, ESLint, and build configurations.
2. **Strict Type Safety & Zero `any` Policy**:
   - Enable `strict: true`, `noImplicitAny: true`, and `strictNullChecks: true`.
   - Validate ALL external inputs, API request bodies, and query parameters with **Zod** schemas before execution.
3. **Frontend & Rendering Guidelines**:
   - Isolate interactive UI state to leaf components. Keep core pages lightweight and performant.
4. **Design System & Aesthetics**:
   - Keep every color, radius, shadow and font in a single token file (CSS variables) and consume tokens everywhere; never hardcode hex values in components.
   - Prefer crisp 1px borders and one subtle shadow scale over blurry default shadows. Pair one sans-serif for body/headings with one monospace for tags, badges, metrics, and code.
5. **Data Layer & Reliability**:
   - Write declarative schema definitions with foreign keys, composite indexes on queried filters, and automated timestamp triggers.
   - Use connection pooling and prepared statements for serverless database execution.
---
## 5. STEP-BY-STEP SCAFFOLDING ROADMAP
- **Phase 1: Workspace & Root Config**: Initialize package manager, monorepo configuration (`turbo.json`, `tsconfig.base.json`, `package.json`).
- **Phase 2: Database Schema & Client**: Set up the data layer (SQLite, PostgreSQL): client, connection pool, models, and migration scripts.
- **Phase 3: Design Tokens & UI Primitives**: Build accessible `Button`, `Input`, `Card`, `Badge`, and layout wrappers inside `packages/ui`.
- **Phase 4: Core Application Routes & Handlers**: Implement primary authentication, user session handling, and application routes.
- **Phase 5: Quality Assurance & Build Verification**: Run `tsc --noEmit`, ESLint, Prettier, and smoke test suites to ensure zero compilation or runtime errors.
---
## 6. EXECUTION INSTRUCTIONS
1. Review all specifications, architectural guardrails, and stack choices above.
2. Present the full monorepo directory tree structure.
3. Systematically generate the complete, production-ready codebase according to the 5-phase roadmap above — starting with the root workspace setup, followed by the database schema, UI design system package, and full-stack application routes until the repository is fully scaffolded and ready to run.
Scaffolded something with this prompt?
Would you pick this stack for a fair-code workflow automation & ai integrator project?

Frequently asked about n8n

What tech stack does n8n use?

n8n is a TypeScript and Vue pnpm monorepo. The editor UI is Vue 3 built with Vite, the server runs on Node.js with Express and a TypeORM data layer, and AI nodes are built on LangChain, all orchestrated with Turborepo.

Does n8n use PostgreSQL or SQLite?

Both. SQLite is the zero-config default compiled into the Docker image, while the @n8n/engine package depends directly on the pg driver so teams can point n8n at PostgreSQL for production.

Can n8n be self-hosted with Docker?

Yes. docker/images/n8n/Dockerfile builds a multi-stage Alpine image that recompiles native modules like sqlite3 and isolated-vm in a dedicated toolchain stage before producing the runtime image.

Does n8n support the Model Context Protocol (MCP)?

Yes. The packages/@n8n/mcp-apps package implements MCP server and UI resources, and the repository is tagged with mcp, mcp-client, and mcp-server topics.

One email a month: new deep dives and stack trends

New source-audited architectures, head-to-head comparisons and the monthly stack report. No spam, unsubscribe anytime.

use-this-stack.md