n8n-io/n8n · error · Error
Subnode output connections are managed by parent node Subnod
Error message
Subnode output connections are managed by parent node SubnodeConfig
What it means
Thrown by SubnodeInstanceImpl.output() — a subnode's output connections are owned by its parent SubnodeConfig. The method is implemented only to conform to the NodeInstance interface; invoking it is a misuse. Use the parent node's API to express how the subnode is wired.
Source
Thrown at packages/@n8n/workflow-sdk/src/workflow-builder/node-builders/subnode-builders.ts:135
parameters: config.parameters ?? this.config.parameters,
credentials: config.credentials ?? this.config.credentials,
};
return new SubnodeInstanceImpl(
this.type,
this.version,
mergedConfig,
this._subnodeType,
this.id,
this.name,
);
}
input(_index: number): InputTarget {
throw new Error('Subnode input connections are managed by parent node SubnodeConfig');
}
output(_index: number): OutputSelector<TType, TVersion, TOutput> {
throw new Error('Subnode output connections are managed by parent node SubnodeConfig');
}
then<T extends NodeInstance<string, string, unknown>>(
_target: T | T[] | InputTarget,
_outputIndex?: number,
): NodeChain<NodeInstance<TType, TVersion, TOutput>, T> {
throw new Error('Subnode connections are managed by parent node SubnodeConfig');
}
to<T extends NodeInstance<string, string, unknown>>(
_target: T | T[] | InputTarget,
_outputIndex?: number,
): NodeChain<NodeInstance<TType, TVersion, TOutput>, T> {
throw new Error('Subnode connections are managed by parent node SubnodeConfig');
}
onError<T extends NodeInstance<string, string, unknown>>(_handler: T): this {
throw new Error('Subnode error handling is managed by parent node SubnodeConfig');View on GitHub (pinned to 5ac6606e81)
Solutions
- Express the subnode's output wiring on the parent SubnodeConfig node, not on the subnode.
- Type-guard against SubnodeInstanceImpl before calling .output().
- Build connections via the parent's subnode-aware API (e.g. agent.to(...), not tool.output(...).to(...)).
Example fix
// before const sel = toolNode.output(0); // throws // after // wire the agent (parent SubnodeConfig), not the tool agent.to(nextNode);
Defensive patterns
Strategy: type-guard
Validate before calling
if (!(node instanceof SubnodeInstanceImpl)) {
const out = node.output(0);
} Type guard
function isSubnodeInstance(n: unknown): n is SubnodeInstanceImpl {
return n instanceof SubnodeInstanceImpl;
} Prevention
- Never chain .output() off a tool/subnode — use the parent agent.
- Type-guard before generic output enumeration.
- Document which builder functions return SubnodeInstanceImpl so callers know.
When it happens
Trigger: Calling myTool.output(0) to build a connection chain from a tool node, or generic graph traversal code that calls .output() on every NodeInstance.
Common situations: Reusing a generic chain builder that assumes all nodes expose outputs; mistakenly treating a tool subnode like a top-level node and chaining .output(...).to(...).
Related errors
- Subnode input connections are managed by parent node Subnode
- Subnode connections are managed by parent node SubnodeConfig
- Subnode error handling is managed by parent node SubnodeConf
- Reflector output must be valid JSON
- INVALID_CONNECTION
AI-assisted analysis of n8n-io/n8n@5ac6606e81 (2026-08-12).
Data as JSON: /api/errors/39c4d958a8330d1b.
Report an issue: GitHub.