n8n-io/n8n · error · NotFoundError

404

404

Error message

Cannot find workflow

What it means

ChatExecutionManager.getRunData throws NotFoundError (404) 'Cannot find workflow' when ownershipService.getWorkflowProjectCached(workflowData.id) throws — i.e. the workflow referenced by a chat execution no longer resolves to a project (deleted, inaccessible, or not yet imported).

Source

Thrown at packages/cli/src/chat/chat-execution-manager.ts:180

		// the `main` channel instead of `ai_tool`, so the agent never sees the approval
		// and the gated tool is never executed. The webhook resume path keys off the
		// same `HitlTool` suffix.
		const resumingNode = runExecutionData.executionData!.nodeExecutionStack[0].node;
		if (resumingNode.type === CHAT_TOOL_NODE_TYPE || isHitlToolType(resumingNode.type)) {
			runExecutionData.waitTill = undefined;
			resumingNode.disabled = true;
			resumingNode.rewireOutputLogTo = NodeConnectionTypes.AiTool;

			const lastNodeExecuted = runExecutionData.resultData.lastNodeExecuted as string;
			const runDataArray = runExecutionData.resultData.runData[lastNodeExecuted];
			if (runDataArray?.length) preserveInputOverride(runDataArray);
		}

		let project: Project | undefined = undefined;
		try {
			project = await this.ownershipService.getWorkflowProjectCached(workflowData.id);
		} catch (error) {
			throw new NotFoundError('Cannot find workflow');
		}

		const runData: IWorkflowExecutionDataProcess = {
			executionMode,
			executionData: runExecutionData,
			pushRef: runExecutionData.pushRef,
			workflowData,
			pinData: runExecutionData.resultData.pinData,
			projectId: project?.id,
		};

		return runData;
	}
}

View on GitHub (pinned to 5ac6606e81)

Solutions

  1. Recreate or re-import the workflow and retry the chat execution.
  2. Ensure the chat trigger runs against a saved, owned workflow id.
  3. Grant the executing user access to the workflow's project.

Example fix

n/a
Defensive patterns

Strategy: try-catch

Validate before calling

// Before resuming, confirm the workflow still has a project
let project;
try { project = await ownershipService.getWorkflowProjectCached(workflowId); }
catch { /* workflow missing: surface not-found before resuming */ }

Type guard

function isNotFoundError(error: unknown): boolean {
  return error instanceof Error && error.message === 'Cannot find workflow';
}

Try / catch

try {
  const runData = await chatExecutionManager.getRunData(execution, message);
} catch (e) {
  if (isNotFoundError(e)) { /* inform user the workflow was deleted/unavailable */ }
  else throw e;
}

Prevention

When it happens

Trigger: A chat trigger resumes an execution whose workflowData.id has no project mapping (workflow deleted, or running against a not-yet-saved workflow id). The try/catch converts any error from the ownership lookup into NotFoundError.

Common situations: Workflow was deleted between the chat execution starting and resuming; chat triggered against a temp/unsaved workflow; cross-project access where the user lost access to the workflow's project.

Related errors


AI-assisted analysis of n8n-io/n8n@5ac6606e81 (2026-08-12). Data as JSON: /api/errors/170e0db7bf0c1656. Report an issue: GitHub.