Back to Explore

n8n

public
masterFair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.
aiapisautomationclidata-flowdevelopment
View on GitHub

AI Architecture

Sign in to run a focused analysis on specific parts of this codebase.

Sign in

Trigger

External service sends HTTP request to n8n webhook URL

1

Webhook Reception

TriggerExpress

Receive webhook request

Express middleware receives incoming HTTP request to webhook endpoint and extracts path, method, headers, and body.

handleWebhookRequest
express
packages/cli/src/webhooks/webhook.controller.ts
2

Webhook Validation

DatabaseTypeORM

Lookup webhook registration

Query database to find workflow associated with webhook path and validate it exists and is active.

findByWebhookPathvalidateWebhook
typeorm
packages/@n8n/db/src/repositories/webhook.repository.ts
3

Workflow Loading

DatabaseTypeORM

Load workflow definition

Retrieve complete workflow definition including all nodes, connections, credentials, and settings from database.

findByIdloadWorkflowData
typeorm
packages/@n8n/db/src/repositories/workflow.repository.ts
4

Execution Creation

DatabaseTypeORM

Create execution record

Insert new execution entry in database with pending status, workflow ID, trigger data, and timestamp.

createExecutionsaveExecutionData
typeorm
packages/@n8n/db/src/repositories/execution.repository.ts
5

Workflow Execution Initialization

ProcessingNode.js

Initialize WorkflowExecute

Create WorkflowExecute instance with workflow definition, execution mode, and initial trigger data.

constructorinitializeExecution
n8n-workflow
packages/core/src/WorkflowExecute.ts
6

Node Execution Loop

ProcessingNode.js

Execute workflow nodes

Traverse workflow graph executing nodes in order, passing data between nodes, handling branching, and managing node credentials.

runNodeexecuteNodeprocessNodeData
n8n-workflown8n-nodes-base
packages/core/src/WorkflowExecute.ts
7

Code Node Execution (if present)

Parallel
ExternalHTTP

Send code to task runner

Send JavaScript or Python code to isolated task runner container via HTTP for sandboxed execution.

executeTasksendCodeToRunner
axios
packages/@n8n/task-runner/src/task-runner.ts
ProcessingDocker

Execute code in sandbox

Task runner executes code in isolated environment with timeout and resource limits, returns results.

runCodeexecuteSandboxed
vm2python-shell
packages/@n8n/task-runner/src/task-executor.ts
8

Binary Data Handling (if present)

ProcessingFilesystem/S3

Store binary data

Save binary files to filesystem or S3 bucket and store reference in execution data.

storeBinaryDatasaveBinaryFile
fs-extraaws-sdk
packages/core/src/BinaryData/BinaryDataManager.ts
9

Execution Completion

DatabaseTypeORM

Update execution status

Update execution record in database with success/error status, output data, duration, and error details if failed.

updateExecutionfinalizeExecution
typeorm
packages/@n8n/db/src/repositories/execution.repository.ts
10

Event Publishing

QueueNode.js

Publish execution events

Emit execution completion events to event bus for audit logging, webhooks, and UI updates.

publishExecutionEventemitEvent
eventemitter3
packages/cli/src/eventbus/event-bus.ts
11

Response

ResponseExpress

Send webhook response

Return HTTP response to original webhook caller with execution results or acknowledgment.

sendResponserespondToWebhook
express
packages/cli/src/webhooks/webhook.controller.ts

Analyzed 2/17/2026, 3:12:32 PM

Languages
TypeScript91.3%
Vue7.2%
SCSS0.5%
JavaScript0.4%
Python0.4%
Handlebars0.1%
Dockerfile0.0%
HCL0.0%
Shell0.0%
HTML0.0%
Just0.0%
CSS0.0%
Rich Text Format0.0%
Batchfile0.0%
Recent Commits
  • D

    feat(core): Add ESLint rule to validate AI node SDK fields in package.json (#25759)

    Dawid Myslak · 1mo ago

  • S

    fix: Increase character limit for providerId (#25748)

    Stephen Wright · 1mo ago

  • I

    feat: Add connection state to secret stores response (no-changelog) (#25884)

    Irénée · 1mo ago

  • A

    fix(editor): Update secrets provider connection name validation (#25868)

    Ali Elkhateeb · 1mo ago

  • T

    fix(core): Forward activationMode in multi-main webhook/trigger setup (#25855)

    Tomi Turtiainen · 1mo ago

Sign in to analyze your own repositories.

Sign in