This page provides an overview of how nodes are defined, packaged, loaded, and executed in n8n. It covers the two built-in node packages, the package metadata format that drives discovery, and the build pipeline that prepares node artifacts at compile time.
For the mechanics of how individual node types are declared and registered at startup, see Node Type System and Registration. For built-in standard nodes, see Standard Nodes and Integrations. For the AI/LangChain node layer, see AI and LangChain Nodes. For credentials, see Credential System. For community nodes and the n8n-node-dev scaffold tool, see Node Development and Community Packages.
A node is the fundamental unit of work in an n8n workflow. Every node is a TypeScript class that implements the INodeType interface from n8n-workflow. The class carries a static description property typed as INodeTypeDescription, which contains all metadata the editor and engine need: parameters, input/output connection types, display name, icon, credentials references, and UI display rules.
Nodes fall into two broad behavioral categories:
| Category | Description | Interface method |
|---|---|---|
| Action / Regular | Execute once per input item batch | execute() |
| Trigger | Start a workflow on external events | trigger() / webhook() |
| AI Sub-node | Supply capabilities to a parent agent node via non-Main connection | supplyData() |
Sub-nodes (LLMs, tools, memory, embeddings, etc.) connect to parent agent nodes over typed connection channels other than Main. The connection type enum is defined in n8n-workflow as NodeConnectionTypes, with values such as AiLanguageModel, AiTool, AiMemory, AiVectorStore, and AiDocument.
n8n ships two built-in node packages and supports additional community packages installed at runtime.
| Package | npm name | Location |
|---|---|---|
| Base nodes | n8n-nodes-base | packages/nodes-base/ |
| LangChain / AI nodes | @n8n/n8n-nodes-langchain | packages/@n8n/nodes-langchain/ |
| Community packages | varies | installed into n8n data dir |
| Node dev CLI | n8n-node-dev | packages/node-dev/ |
Both built-in packages declare their contents inside a top-level n8n field in package.json. This field is the single source of truth the loader uses to discover what to register.
Node Package Declaration Diagram ā how the n8n field maps to what the loader reads:
Sources: packages/nodes-base/package.json24-680 packages/@n8n/nodes-langchain/package.json44-186
n8n-nodes-basen8n-nodes-base contains over 200 action and trigger nodes organized by service. Each service folder under packages/nodes-base/nodes/ typically contains a main action node and optionally a *Trigger node. Credential files live under packages/nodes-base/credentials/.
The build script for this package runs these steps in order:
tsc ā copy-nodes-json ā tsc-alias ā n8n-copy-static-files ā n8n-generate-translations ā n8n-generate-metadata ā n8n-generate-node-defs
Sources: packages/nodes-base/package.json11
The n8n-copy-static-files, n8n-generate-translations, n8n-generate-metadata, and n8n-generate-node-defs binaries are all provided by n8n-core.
Sources: packages/core/package.json8-11
@n8n/n8n-nodes-langchainThe LangChain package is structured by node category rather than by service. Every directory under packages/@n8n/nodes-langchain/nodes/ corresponds to one functional role.
LangChain Node Category Map ā directory paths mapped to logical roles:
Sources: packages/@n8n/nodes-langchain/package.json77-186
Nodes connect to each other via typed ports. Standard data flow uses Main. AI sub-nodes supply capabilities to a parent node over specialty connection types. These are declared in the INodeTypeDescription.inputs and outputs arrays and correspond to the NodeConnectionTypes enum in n8n-workflow.
| Connection type key | Typical consumer | Typical supplier |
|---|---|---|
main | Any action node | Upstream action node |
ai_language_model | Agent, Chain nodes | LLM nodes |
ai_tool | Agent nodes | Tool nodes |
ai_memory | Agent nodes | Memory nodes |
ai_vector_store | Retriever, Vector store nodes | Vector store nodes |
ai_document | Vector store (insert) | Document loader nodes |
ai_text_splitter | Document loaders | Text splitter nodes |
ai_embedding | Vector store nodes | Embedding nodes |
ai_output_parser | Chain nodes | Output parser nodes |
Sources: packages/core/src/execution-engine/partial-execution-utils/clean-run-data.ts1-4 packages/workflow/test/fixtures/WorkflowDataProxy/agentInfo_workflow.json1-130
Every node package produces a compiled dist/ directory that includes:
.node.js, .credentials.js)*.node.json)Node Package Build Artifact Flow:
All four generation scripts (n8n-copy-static-files, n8n-generate-translations, n8n-generate-metadata, n8n-generate-node-defs) are bin entries provided by the n8n-core package and run during both nodes-base and nodes-langchain builds.
Sources: packages/core/package.json7-11 packages/nodes-base/package.json11 packages/@n8n/nodes-langchain/package.json31
The following diagram shows how the relevant packages depend on each other in the context of the node system.
Node System Package Dependencies:
Sources: packages/core/package.json42-83 packages/nodes-base/package.json1-20 packages/@n8n/nodes-langchain/package.json202-283 packages/node-dev/package.json43-54 packages/cli/package.json96-198
n8n supports multiple versions of the same node type so that existing workflows remain compatible when a node's behavior changes. When a node is versioned, each version is a separate class. The INodeTypeDescription.version field can be a number or an array of numbers. The defaultVersion property controls which version new nodes default to when added to a canvas.
Versioned node files typically follow naming conventions like HttpRequestV1.node.ts, HttpRequestV2.node.ts, HttpRequestV3.node.ts within a service directory, with a top-level file (e.g., HttpRequest.node.ts) that assembles and exports all versions.
For a worked example covering HttpRequest node versioning, see Standard Nodes and Integrations.
| Page | Topic |
|---|---|
| 4.1 Node Type System and Registration | INodeType, INodeTypeDescription, DirectoryLoader, LoadNodesAndCredentials, how nodes are discovered and registered at startup |
| 4.2 Standard Nodes and Integrations | Architecture of built-in nodes, versioned nodes, HttpRequest as a reference example, GenericFunctions utilities |
| 4.3 AI and LangChain Nodes | Agent node, LLM nodes, sub-node supply pattern, supplyData(), tool execution |
| 4.4 Credential System | ICredentialType, CredentialsHelper, CredentialTypes registry, per-node credential declarations and resolution |
| 4.5 Node Development and Community Packages | n8n-node-dev CLI, community package install/update/remove lifecycle, CommunityPackagesController |
Refresh this wiki
This wiki was recently refreshed. Please wait 2 days to refresh again.