n8n-io/n8n · error · Error
Delegated child checkpoint does not match the selected sub-a
Error message
Delegated child checkpoint does not match the selected sub-agent
What it means
Thrown by restoreDelegateRequest when the checkpoint's subAgentId does not match the subAgentId in the current resume input. This guard prevents resuming a delegated child under a different sub-agent than the one that originally started — which would execute the wrong agent's logic with stale context.
Source
Thrown at packages/@n8n/agents/src/runtime/tools/delegate-sub-agent-tool.ts:774
);
}
function restoreDelegateRequest(
input: DelegateSubAgentInput,
ctx: ToolContext,
continuation: JSONValue,
policy: DelegateSubAgentPolicy | undefined,
childPathIndexes: Map<string, number>,
): {
checkpoint: DelegateSubAgentContinuation & { taskPath: SubAgentTaskPath };
request: DelegateSubAgentRequest;
} {
const checkpoint = parseDelegateSubAgentContinuation(continuation);
if (!checkpoint) {
throw new Error('Delegated child checkpoint metadata is missing or invalid');
}
if (checkpoint.subAgentId !== input.subAgentId) {
throw new Error('Delegated child checkpoint does not match the selected sub-agent');
}
const { taskPath } = checkpoint;
assertSubAgentTaskPath(taskPath);
const key = getChildPathIndexKey(ctx);
childPathIndexes.set(key, Math.max(childPathIndexes.get(key) ?? 0, checkpoint.childCount + 1));
const request = createDelegateSubAgentRequest(
input,
ctx,
taskPath,
checkpoint.childCount,
policy,
);
return { checkpoint: { ...checkpoint, taskPath }, request };
}
function getChildCheckpointTarget(checkpoint: DelegateSubAgentContinuation) {
return {
childRunId: checkpoint.runId,View on GitHub (pinned to 5ac6606e81)
Solutions
- Ensure the sub-agent configuration is stable between suspend and resume (same availableSubAgents list and identifiers).
- If the sub-agent set legitimately changed, start a new delegation rather than resuming the stale one.
- Verify that sub-agent IDs are deterministic and not regenerated on each build.
Defensive patterns
Strategy: validation
Validate before calling
function continuationMatchesInput(continuation: DelegateSubAgentContinuation, input: DelegateSubAgentInput): boolean {
return continuation.subAgentId === input.subAgentId;
}
if (!continuationMatchesInput(storedContinuation, resumeInput)) {
// sub-agent set changed; do not resume
} Try / catch
try {
await agent.resume(resumeData);
} catch (e) {
if (e instanceof Error && e.message.includes('does not match')) {
// re-select the correct sub-agent or start fresh
} else throw e;
} Prevention
- Keep the sub-agent list stable between suspend and resume.
- Use deterministic, stable sub-agent IDs that do not change across restarts.
- Avoid dynamically adding or removing sub-agents while delegations are suspended.
When it happens
Trigger: The availableSubAgents list or selection logic changed between suspend and resume, causing the resume input to reference a different subAgentId than the one recorded in the continuation checkpoint. Also triggered by manual tampering with the resume payload or a bug in sub-agent selection logic.
Common situations: Editing the agent configuration (adding/removing/reordering sub-agents) between when a delegation suspended and when the user resumes. Dynamic sub-agent registration that is non-deterministic across restarts. Passing a hand-crafted resume payload with the wrong subAgentId.
Related errors
- Delegated child checkpoint metadata is missing or invalid
- No pending tool call found for toolCallId: ${resumedId}
- Run ${runId} is not suspended. Cannot resume.
- Invalid delegate sub-agent tool name "${name}": must start w
- ${toolName} requires resumeSubAgent and cancelSubAgent to be
AI-assisted analysis of n8n-io/n8n@5ac6606e81 (2026-08-12).
Data as JSON: /api/errors/688b0e97366cc3a2.
Report an issue: GitHub.