{"record":{"id":"2325a996e034e0c7","repo":"n8n-io/n8n","slug":"invalid-prebuilt-workflows-manifest-at-path","errorCode":null,"errorMessage":"Invalid prebuilt-workflows manifest at ${path}: ${result.error.issues.map((i) => `${i.path.join('.')}: ${i.message}`).join('; ')}","messagePattern":"Invalid prebuilt-workflows manifest at (.+?): (.+?): (.+?)`\\)\\.join\\('; '\\)\\}","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/@n8n/instance-ai/evaluations/harness/prebuilt-workflows.ts","lineNumber":43,"sourceCode":"import 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`)\n *   • the manifest exists but doesn't cover this slug (fall through to the\n *     regular orchestrator build path)\n */\nexport function pickPrebuiltWorkflowId(","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/instance-ai/evaluations/harness/prebuilt-workflows.ts#L25-L61","documentation":"Thrown by loadPrebuiltManifest when the file was read and parsed successfully but its shape failed Zod validation against prebuiltManifestSchema (a non-empty record of string → array-of-non-empty-strings). The error lists every Zod issue with its path and message so the caller can locate each violation.","triggerScenarios":"Manifest is an empty object; a key is an empty string; a value is not an array; an array entry is empty or non-string; the top-level value is an array or primitive instead of a record.","commonSituations":"Hand-authoring the manifest and forgetting the slug → [workflowIds] shape; a workflow ID is an empty string; the manifest was auto-generated from a different schema and does not match.","solutions":["Read each `path: message` segment in the error — the path identifies the offending key/index.","Ensure the top-level value is a plain object (record), not an array.","Ensure every key is a non-empty string (the case slug) and every value is a non-empty array of non-empty workflow ID strings.","Ensure the object is not empty (at least one entry)."],"exampleFix":"// before — empty array instead of record, and an empty id\n[]\n// or\n{ \"good-slug\": [\"wf-1\", \"\"] }\n\n// after — non-empty record, all ids non-empty\n{ \"good-slug\": [\"wf-1\", \"wf-2\"] }","handlingStrategy":"validation","validationCode":"import { prebuiltManifestSchema } from './prebuilt-workflows';\n\nfunction manifestValidates(raw: unknown): boolean {\n  return prebuiltManifestSchema.safeParse(raw).success;\n}\n\nconst raw = JSON.parse(readFileSync(path, 'utf8'));\nif (!manifestValidates(raw)) {\n  throw new Error('manifest shape invalid; see schema');\n}","typeGuard":"function isManifestInvalidError(e: unknown): boolean {\n  return e instanceof Error && e.message.startsWith('Invalid prebuilt-workflows manifest at ');\n}","tryCatchPattern":"try {\n  loadPrebuiltManifest(path);\n} catch (e) {\n  if (e instanceof Error && e.message.startsWith('Invalid prebuilt-workflows manifest')) {\n    // e.message lists each Zod issue path — fix the manifest entries\n  }\n  throw e;\n}","preventionTips":["Author manifests with a JSON schema validator in your editor.","Run prebuiltManifestSchema.parse on manifest edits in a unit test.","Never hand-edit generated manifests; regenerate from the source of truth."],"tags":["zod","validation","manifest","configuration"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}