n8n-io/n8n · error

Instance AI runtime workspace is unavailable.

Error message

Instance AI runtime workspace is unavailable.

What it means

LazyRuntimeWorkspace.getWorkspace awaited the workspace promise but got a falsy workspace — the lazy ensure/resolve cycle produced nothing (e.g. destroy raced with resolution). The cached promise is invalidated so the next call retries; this error means the runtime workspace could not be provided at all.

Solutions

  1. Retry the operation so the workspace is lazily re-created
  2. Check the workspace provider logs for why creation/destroy raced and fix the lifecycle
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at packages/@n8n/instance-ai/src/workspace/lazy-runtime-workspace.ts:113 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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

Appendix: source

Thrown at packages/@n8n/instance-ai/src/workspace/lazy-runtime-workspace.ts:113

	onDestroyed(listener: WorkspaceDestroyedListener): void {
		this.destroyedListeners.add(listener);
	}

	async getWorkspace(): Promise<Workspace> {
		this.workspacePromise ??= this.ensureWorkspace()
			.then((workspace) => {
				this.setResolvedWorkspace(workspace);
				return workspace;
			})
			.catch((error: unknown) => {
				this.workspacePromise = undefined;
				throw error;
			});

		const workspace = await this.workspacePromise;
		if (!workspace) {
			this.workspacePromise = undefined;
			throw new Error('Instance AI runtime workspace is unavailable.');
		}

		return workspace;
	}

	async destroyResolvedWorkspace(): Promise<void> {
		if (this.workspaceDestroyPromise) return await this.workspaceDestroyPromise;

		const workspace =
			this.resolvedWorkspace ?? (await this.workspacePromise?.catch(() => undefined));
		if (!workspace) {
			this.workspacePromise = undefined;
			return;
		}

		this.workspaceDestroyPromise = workspace.destroy().then(() => {
			this.workspacePromise = undefined;
			this.resolvedWorkspace = undefined;

View on GitHub (pinned to 5ac6606e81)