{"record":{"id":"8b046baa41d3f290","repo":"n8n-io/n8n","slug":"failed-to-read-prebuilt-workflows-manifest-at-pa","errorCode":null,"errorMessage":"Failed to read prebuilt-workflows manifest at ${path}: ${msg}","messagePattern":"Failed to read prebuilt-workflows manifest at (.+?): (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/@n8n/instance-ai/evaluations/harness/prebuilt-workflows.ts","lineNumber":39,"sourceCode":"import { z } from 'zod';\n\nimport type { BuildResult } from './build-workflow';\nimport type { EvalLogger } from './logger';\nimport type { N8nClient } from '../clients/n8n-client';\n\nexport const prebuiltManifestSchema = z\n\t.record(z.string().min(1), z.array(z.string().min(1)).min(1))\n\t.refine((v) => Object.keys(v).length > 0, { message: 'manifest must not be empty' });\n\nexport type PrebuiltManifest = z.infer<typeof prebuiltManifestSchema>;\n\nexport function loadPrebuiltManifest(path: string): PrebuiltManifest {\n\tlet raw: unknown;\n\ttry {\n\t\traw = JSON.parse(readFileSync(path, 'utf-8'));\n\t} catch (error) {\n\t\tconst msg = error instanceof Error ? error.message : String(error);\n\t\tthrow new Error(`Failed to read prebuilt-workflows manifest at ${path}: ${msg}`);\n\t}\n\tconst result = prebuiltManifestSchema.safeParse(raw);\n\tif (!result.success) {\n\t\tthrow new Error(\n\t\t\t`Invalid prebuilt-workflows manifest at ${path}: ${result.error.issues\n\t\t\t\t.map((i) => `${i.path.join('.')}: ${i.message}`)\n\t\t\t\t.join('; ')}`,\n\t\t);\n\t}\n\treturn result.data;\n}\n\n/**\n * Look up the workflow ID for a given test-case file slug + iteration.\n *\n * Returns `undefined` in two cases — callers cannot distinguish them and\n * shouldn't need to:\n *   • the manifest argument itself is undefined (no `--prebuilt-workflows`)","sourceCodeStart":21,"sourceCodeEnd":57,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/instance-ai/evaluations/harness/prebuilt-workflows.ts#L21-L57","documentation":"Thrown by loadPrebuiltManifest when readFileSync or JSON.parse fails on the manifest path — the file is missing, unreadable, or not valid JSON. The error wraps the underlying filesystem/parse error message so the caller can see the exact OS/parse cause.","triggerScenarios":"The manifest path does not exist; the path points at a directory; insufficient read permissions; the file exists but contains malformed JSON (trailing comma, unquoted keys, BOM issues).","commonSituations":"CI checkout missing the generated manifest file; relative path resolved against an unexpected cwd; the manifest was hand-edited and broke JSON syntax; the file was gitignored and not committed.","solutions":["Check the underlying error message embedded in the thrown string (e.g. ENOENT, EACCES, Unexpected token) to classify the cause.","Verify the path exists and is a file: `fs.statSync(path).isFile()`.","If missing, generate or regenerate the manifest (run the project's manifest-generation step).","If malformed, validate the JSON with a linter/editor and fix the syntax error."],"exampleFix":"// before\nloadPrebuiltManifest('./prebuilt-workflows.json');\n\n// after — verify existence and provide a clear fallback path\nconst path = './prebuilt-workflows.json';\nif (!fs.existsSync(path)) throw new Error(`manifest missing at ${path}; run the generator first`);\nloadPrebuiltManifest(path);","handlingStrategy":"validation","validationCode":"import { existsSync, statSync } from 'node:fs';\n\nfunction manifestReadable(path: string): boolean {\n  try {\n    return existsSync(path) && statSync(path).isFile();\n  } catch {\n    return false;\n  }\n}\n\nif (!manifestReadable(path)) {\n  throw new Error(`manifest not readable at ${path}; generate it first`);\n}","typeGuard":"function isManifestReadError(e: unknown): boolean {\n  return e instanceof Error && e.message.startsWith('Failed to read prebuilt-workflows manifest at ');\n}","tryCatchPattern":"try {\n  loadPrebuiltManifest(path);\n} catch (e) {\n  if (e instanceof Error && e.message.startsWith('Failed to read prebuilt-workflows manifest')) {\n    // regenerate or fall back to a known-good path\n  }\n  throw e;\n}","preventionTips":["Generate the manifest in the build step before running evals.","Commit the manifest or fetch it from artefact storage in CI.","Use absolute paths to avoid cwd-relative resolution surprises."],"tags":["filesystem","json","configuration","manifest"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}