{"record":{"id":"492e6b4c49033177","repo":"n8n-io/n8n","slug":"sandbox-workspace-setup-failed-during-step-g","errorCode":null,"errorMessage":"Sandbox workspace setup failed during ${step}: ${getErrorMessage(originalError)}","messagePattern":"Sandbox workspace setup failed during (.+?): (.+?)","errorType":"exception","errorClass":"SandboxWorkspaceSetupError","httpStatus":null,"severity":"error","filePath":"packages/@n8n/instance-ai/src/workspace/sandbox-setup.ts","lineNumber":82,"sourceCode":"function getErrorMessage(error: unknown): string {\n\treturn error instanceof Error ? error.message : String(error);\n}\n\nexport class SandboxWorkspaceSetupError extends Error {\n\tconstructor(\n\t\treadonly step: SandboxWorkspaceSetupStep,\n\t\treadonly originalError: unknown,\n\t) {\n\t\tsuper(`Sandbox workspace setup failed during ${step}: ${getErrorMessage(originalError)}`);\n\t\tthis.name = 'SandboxWorkspaceSetupError';\n\t}\n}\n\nasync function setupStep<T>(step: SandboxWorkspaceSetupStep, action: () => Promise<T>): Promise<T> {\n\ttry {\n\t\treturn await action();\n\t} catch (error) {\n\t\tthrow new SandboxWorkspaceSetupError(step, error);\n\t}\n}\n\n/**\n * Resolve a dependency's installed version from the host's node_modules.\n * Falls back to `'*'` if the package is unresolvable (should only happen in\n * out-of-tree test setups — production always has these as real deps).\n */\nfunction resolveHostDepVersion(name: string): string {\n\ttry {\n\t\tconst pkg = hostRequire(`${name}/package.json`) as { version?: string };\n\t\treturn pkg.version ?? '*';\n\t} catch {\n\t\treturn '*';\n\t}\n}\n\n/**","sourceCodeStart":64,"sourceCodeEnd":100,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/instance-ai/src/workspace/sandbox-setup.ts#L64-L100","documentation":"Error \"Sandbox workspace setup failed during ${step}: ${getErrorMessage(originalError)}\" thrown in n8n-io/n8n.","triggerScenarios":"Thrown at packages/@n8n/instance-ai/src/workspace/sandbox-setup.ts:82 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-13T14:17:21.547Z"}