n8n-io/n8n · error · Error

Invalid prebuilt-workflows manifest at ${path}: ${result.err

Error message

Invalid prebuilt-workflows manifest at ${path}: ${result.error.issues.map((i) => `${i.path.join('.')}: ${i.message}`).join('; ')}

What it means

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.

Source

Thrown at packages/@n8n/instance-ai/evaluations/harness/prebuilt-workflows.ts:43

import type { N8nClient } from '../clients/n8n-client';

export const prebuiltManifestSchema = z
	.record(z.string().min(1), z.array(z.string().min(1)).min(1))
	.refine((v) => Object.keys(v).length > 0, { message: 'manifest must not be empty' });

export type PrebuiltManifest = z.infer<typeof prebuiltManifestSchema>;

export function loadPrebuiltManifest(path: string): PrebuiltManifest {
	let raw: unknown;
	try {
		raw = JSON.parse(readFileSync(path, 'utf-8'));
	} catch (error) {
		const msg = error instanceof Error ? error.message : String(error);
		throw new Error(`Failed to read prebuilt-workflows manifest at ${path}: ${msg}`);
	}
	const result = prebuiltManifestSchema.safeParse(raw);
	if (!result.success) {
		throw new Error(
			`Invalid prebuilt-workflows manifest at ${path}: ${result.error.issues
				.map((i) => `${i.path.join('.')}: ${i.message}`)
				.join('; ')}`,
		);
	}
	return result.data;
}

/**
 * Look up the workflow ID for a given test-case file slug + iteration.
 *
 * Returns `undefined` in two cases — callers cannot distinguish them and
 * shouldn't need to:
 *   • the manifest argument itself is undefined (no `--prebuilt-workflows`)
 *   • the manifest exists but doesn't cover this slug (fall through to the
 *     regular orchestrator build path)
 */
export function pickPrebuiltWorkflowId(

View on GitHub (pinned to 5ac6606e81)

Solutions

  1. Read each `path: message` segment in the error — the path identifies the offending key/index.
  2. Ensure the top-level value is a plain object (record), not an array.
  3. 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.
  4. Ensure the object is not empty (at least one entry).

Example fix

// before — empty array instead of record, and an empty id
[]
// or
{ "good-slug": ["wf-1", ""] }

// after — non-empty record, all ids non-empty
{ "good-slug": ["wf-1", "wf-2"] }
Defensive patterns

Strategy: validation

Validate before calling

import { prebuiltManifestSchema } from './prebuilt-workflows';

function manifestValidates(raw: unknown): boolean {
  return prebuiltManifestSchema.safeParse(raw).success;
}

const raw = JSON.parse(readFileSync(path, 'utf8'));
if (!manifestValidates(raw)) {
  throw new Error('manifest shape invalid; see schema');
}

Type guard

function isManifestInvalidError(e: unknown): boolean {
  return e instanceof Error && e.message.startsWith('Invalid prebuilt-workflows manifest at ');
}

Try / catch

try {
  loadPrebuiltManifest(path);
} catch (e) {
  if (e instanceof Error && e.message.startsWith('Invalid prebuilt-workflows manifest')) {
    // e.message lists each Zod issue path — fix the manifest entries
  }
  throw e;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


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