# fares-ojel/n8n architecture

> Architecture diagram of the GitHub repository fares-ojel/n8n, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/fares-ojel/n8n
- Repository: https://github.com/fares-ojel/n8n

## Overview

n8n is a self-hostable workflow-automation platform. The main user journey is to build or import a workflow, configure its nodes and integrations, then run it and inspect the outcome. The repository also contains an AI-agent runtime, node discovery, and workspace tools for code-enabled workflows. This map combines documented capabilities with sampled source and the source index; several core execution and editor subsystems are unsampled, so their connections are shown only where documented or evidenced by indexed references.

Main entry points: [`packages/@n8n/agents/src/runtime/loop/agent-runtime.ts`](https://github.com/fares-ojel/n8n/blob/master/packages/%40n8n/agents/src/runtime/loop/agent-runtime.ts) (Agent runtime), [`packages/cli/src/modules/agents/agent-execution-orchestrator.service.ts`](https://github.com/fares-ojel/n8n/blob/master/packages/cli/src/modules/agents/agent-execution-orchestrator.service.ts) (Agent orchestration), [`packages/frontend/editor-ui/src`](https://github.com/fares-ojel/n8n/tree/master/packages/frontend/editor-ui/src) (Workflow editor), [`packages/cli/src/workflows/workflows.controller.ts`](https://github.com/fares-ojel/n8n/blob/master/packages/cli/src/workflows/workflows.controller.ts) (Workflow API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_authoring["Workflow authoring"]
  node_editor["Workflow editor"]
  node_import["Package import<br/>[import-pipeline.ts]"]
  node_workflow_api["Workflow API"]
  node_node_catalog["Node catalog search<br/>[search-engine.ts]"]
end

subgraph group_execution["Workflow execution"]
  node_engine["Execution engine"]
end

subgraph group_ai["AI capabilities"]
  node_agent_orchestrator["Agent orchestration"]
  node_agent_runtime["Agent runtime<br/>[agent-runtime.ts]"]
  node_agent_model["Model handling<br/>[model-factory.ts]"]
  node_agent_tools["Agent tools"]
  node_agent_memory["Agent memory"]
  node_agent_stream["Agent streaming<br/>[stream.ts]"]
  node_workspace["Code workspace"]
  node_instance_search["Instance AI search"]
  node_evals["Agent evaluations"]
end

subgraph group_integrations["Integrations and extensions"]
  node_integration_nodes["Integration nodes"]
  node_cloud_storage["Cloud storage node"]
end

node_user(("Technical team"))

node_user -->|"builds workflows"| node_editor
node_user -->|"imports packages"| node_import
node_editor -.->|"manages workflows"| node_workflow_api
node_workflow_api -.->|"runs workflows"| node_engine
node_editor -.->|"discovers nodes"| node_node_catalog
node_engine -->|"executes nodes"| node_integration_nodes
node_integration_nodes -->|"includes"| node_cloud_storage
node_user -.->|"starts AI runs"| node_agent_orchestrator
node_agent_orchestrator -->|"streams run"| node_agent_runtime
node_agent_orchestrator -->|"gets runtime"| node_agent_runtime
node_agent_runtime -.->|"uses models"| node_agent_model
node_agent_runtime -.->|"executes tools"| node_agent_tools
node_agent_runtime -.->|"uses memory"| node_agent_memory
node_agent_runtime -.->|"emits stream"| node_agent_stream
node_agent_runtime -.->|"uses workspace"| node_workspace
node_agent_orchestrator -.->|"evaluates runs"| node_evals
node_agent_orchestrator -.->|"searches nodes"| node_instance_search
node_cloud_storage -->|"connects services"| node_user

click node_editor "https://github.com/fares-ojel/n8n/tree/master/packages/frontend/editor-ui/src"
click node_import "https://github.com/fares-ojel/n8n/blob/master/packages/cli/src/modules/n8n-packages/engine/import-pipeline.ts"
click node_workflow_api "https://github.com/fares-ojel/n8n/blob/master/packages/cli/src/workflows/workflows.controller.ts"
click node_engine "https://github.com/fares-ojel/n8n/tree/master/packages/core/src/execution-engine"
click node_node_catalog "https://github.com/fares-ojel/n8n/blob/master/packages/%40n8n/ai-utilities/src/node-catalog/search-engine.ts"
click node_integration_nodes "https://github.com/fares-ojel/n8n/tree/master/packages/nodes-base/nodes"
click node_agent_orchestrator "https://github.com/fares-ojel/n8n/blob/master/packages/cli/src/modules/agents/agent-execution-orchestrator.service.ts"
click node_agent_runtime "https://github.com/fares-ojel/n8n/blob/master/packages/%40n8n/agents/src/runtime/loop/agent-runtime.ts"
click node_agent_model "https://github.com/fares-ojel/n8n/blob/master/packages/%40n8n/agents/src/runtime/model/model-factory.ts"
click node_agent_tools "https://github.com/fares-ojel/n8n/blob/master/packages/%40n8n/agents/src/runtime/tools/tool-call-executor.ts"
click node_agent_memory "https://github.com/fares-ojel/n8n/blob/master/packages/%40n8n/agents/src/runtime/memory/memory-orchestrator.ts"
click node_agent_stream "https://github.com/fares-ojel/n8n/blob/master/packages/%40n8n/agents/src/runtime/streaming/stream.ts"
click node_workspace "https://github.com/fares-ojel/n8n/tree/master/packages/%40n8n/agents/src/workspace"
click node_instance_search "https://github.com/fares-ojel/n8n/blob/master/packages/%40n8n/instance-ai/src/tools/nodes/node-search-engine.ts"
click node_evals "https://github.com/fares-ojel/n8n/tree/master/packages/%40n8n/agents/src/evals"
click node_cloud_storage "https://github.com/fares-ojel/n8n/blob/master/packages/nodes-base/nodes/Google/CloudStorage/GoogleCloudStorage.node.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_editor,node_import,node_workflow_api,node_node_catalog toneBlue
class node_engine toneAmber
class node_agent_orchestrator,node_agent_runtime,node_agent_model,node_agent_tools,node_agent_memory,node_agent_stream,node_workspace,node_instance_search,node_evals toneMint
class node_integration_nodes,node_cloud_storage toneRose
class node_user toneIndigo
```

## Components

### Workflow authoring

- [Workflow editor](https://github.com/fares-ojel/n8n/tree/master/packages/frontend/editor-ui/src): `packages/frontend/editor-ui/src`
- [Package import](https://github.com/fares-ojel/n8n/blob/master/packages/cli/src/modules/n8n-packages/engine/import-pipeline.ts): `packages/cli/src/modules/n8n-packages/engine/import-pipeline.ts`
- [Workflow API](https://github.com/fares-ojel/n8n/blob/master/packages/cli/src/workflows/workflows.controller.ts): `packages/cli/src/workflows/workflows.controller.ts`
- [Node catalog search](https://github.com/fares-ojel/n8n/blob/master/packages/%40n8n/ai-utilities/src/node-catalog/search-engine.ts): `packages/@n8n/ai-utilities/src/node-catalog/search-engine.ts`

### Workflow execution

- [Execution engine](https://github.com/fares-ojel/n8n/tree/master/packages/core/src/execution-engine): `packages/core/src/execution-engine`

### AI capabilities

- [Agent orchestration](https://github.com/fares-ojel/n8n/blob/master/packages/cli/src/modules/agents/agent-execution-orchestrator.service.ts): `packages/cli/src/modules/agents/agent-execution-orchestrator.service.ts`
- [Agent runtime](https://github.com/fares-ojel/n8n/blob/master/packages/%40n8n/agents/src/runtime/loop/agent-runtime.ts): `packages/@n8n/agents/src/runtime/loop/agent-runtime.ts`
- [Model handling](https://github.com/fares-ojel/n8n/blob/master/packages/%40n8n/agents/src/runtime/model/model-factory.ts): `packages/@n8n/agents/src/runtime/model/model-factory.ts`
- [Agent tools](https://github.com/fares-ojel/n8n/blob/master/packages/%40n8n/agents/src/runtime/tools/tool-call-executor.ts): `packages/@n8n/agents/src/runtime/tools/tool-call-executor.ts`
- [Agent memory](https://github.com/fares-ojel/n8n/blob/master/packages/%40n8n/agents/src/runtime/memory/memory-orchestrator.ts): `packages/@n8n/agents/src/runtime/memory/memory-orchestrator.ts`
- [Agent streaming](https://github.com/fares-ojel/n8n/blob/master/packages/%40n8n/agents/src/runtime/streaming/stream.ts): `packages/@n8n/agents/src/runtime/streaming/stream.ts`
- [Code workspace](https://github.com/fares-ojel/n8n/tree/master/packages/%40n8n/agents/src/workspace): `packages/@n8n/agents/src/workspace`
- [Instance AI search](https://github.com/fares-ojel/n8n/blob/master/packages/%40n8n/instance-ai/src/tools/nodes/node-search-engine.ts): `packages/@n8n/instance-ai/src/tools/nodes/node-search-engine.ts`
- [Agent evaluations](https://github.com/fares-ojel/n8n/tree/master/packages/%40n8n/agents/src/evals): `packages/@n8n/agents/src/evals`

### Integrations and extensions

- [Integration nodes](https://github.com/fares-ojel/n8n/tree/master/packages/nodes-base/nodes): `packages/nodes-base/nodes`
- [Cloud storage node](https://github.com/fares-ojel/n8n/blob/master/packages/nodes-base/nodes/Google/CloudStorage/GoogleCloudStorage.node.ts): `packages/nodes-base/nodes/Google/CloudStorage/GoogleCloudStorage.node.ts`

### Other components

- **Technical team**

## Connections

- Technical team → Workflow editor: builds workflows (evidence: `README.md`)
- Technical team → Package import: imports packages (evidence: `README.md`)
- Workflow editor → Workflow API: manages workflows
- Workflow API → Execution engine: runs workflows
- Workflow editor → Node catalog search: discovers nodes
- Execution engine → Integration nodes: executes nodes (evidence: `README.md`)
- Integration nodes → Cloud storage node: includes (evidence: `README.md`)
- Technical team → Agent orchestration: starts AI runs
- Agent orchestration → Agent runtime: streams run (evidence: `packages/cli/src/modules/agents/agent-execution-orchestrator.service.ts`)
- Agent orchestration → Agent runtime: gets runtime (evidence: `packages/cli/src/modules/agents/agent-execution-orchestrator.service.ts`)
- Agent runtime → Model handling: uses models
- Agent runtime → Agent tools: executes tools
- Agent runtime → Agent memory: uses memory
- Agent runtime → Agent streaming: emits stream
- Agent runtime → Code workspace: uses workspace
- Agent orchestration → Agent evaluations: evaluates runs
- Agent orchestration → Instance AI search: searches nodes
- Cloud storage node → Technical team: connects services (evidence: `packages/nodes-base/nodes/Google/CloudStorage/GoogleCloudStorage.node.ts`)
