{"record":{"id":"9d19b2585fd2800a","repo":"n8n-io/n8n","slug":"instance-ai-runtime-workspace-is-unavailable","errorCode":null,"errorMessage":"Instance AI runtime workspace is unavailable.","messagePattern":"Instance AI runtime workspace is unavailable\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/@n8n/instance-ai/src/workspace/lazy-runtime-workspace.ts","lineNumber":113,"sourceCode":"\tonDestroyed(listener: WorkspaceDestroyedListener): void {\n\t\tthis.destroyedListeners.add(listener);\n\t}\n\n\tasync getWorkspace(): Promise<Workspace> {\n\t\tthis.workspacePromise ??= this.ensureWorkspace()\n\t\t\t.then((workspace) => {\n\t\t\t\tthis.setResolvedWorkspace(workspace);\n\t\t\t\treturn workspace;\n\t\t\t})\n\t\t\t.catch((error: unknown) => {\n\t\t\t\tthis.workspacePromise = undefined;\n\t\t\t\tthrow error;\n\t\t\t});\n\n\t\tconst workspace = await this.workspacePromise;\n\t\tif (!workspace) {\n\t\t\tthis.workspacePromise = undefined;\n\t\t\tthrow new Error('Instance AI runtime workspace is unavailable.');\n\t\t}\n\n\t\treturn workspace;\n\t}\n\n\tasync destroyResolvedWorkspace(): Promise<void> {\n\t\tif (this.workspaceDestroyPromise) return await this.workspaceDestroyPromise;\n\n\t\tconst workspace =\n\t\t\tthis.resolvedWorkspace ?? (await this.workspacePromise?.catch(() => undefined));\n\t\tif (!workspace) {\n\t\t\tthis.workspacePromise = undefined;\n\t\t\treturn;\n\t\t}\n\n\t\tthis.workspaceDestroyPromise = workspace.destroy().then(() => {\n\t\t\tthis.workspacePromise = undefined;\n\t\t\tthis.resolvedWorkspace = undefined;","sourceCodeStart":95,"sourceCodeEnd":131,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/instance-ai/src/workspace/lazy-runtime-workspace.ts#L95-L131","documentation":"Error \"Instance AI runtime workspace is unavailable.\" thrown in n8n-io/n8n.","triggerScenarios":"Thrown at packages/@n8n/instance-ai/src/workspace/lazy-runtime-workspace.ts:113 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}