n8n-io/n8n · error · Error

--delete-prebuilt-workflows requires --prebuilt-workflows

Error message

--delete-prebuilt-workflows requires --prebuilt-workflows

What it means

Thrown by parseCliArgs() when --delete-prebuilt-workflows is set but --prebuilt-workflows is not. The delete flag's sole purpose is to clean up workflows that were consumed from a pre-built manifest after evaluation; without a manifest path there is nothing to delete. The parser rejects the orphan flag rather than silently no-op'ing.

Source

Thrown at packages/@n8n/instance-ai/evaluations/cli/args.ts:206

	// MCP builds are LangSmith-only: the keyless direct loop parallelizes
	// iterations without the lane allocator, so its 4-per-lane build cap applies
	// PER ITERATION — concurrent `claude` sessions would scale with
	// lanes × iterations × 4 and flood the shared Anthropic budget. Fail fast
	// instead of teaching the direct loop (tech debt slated for removal) MCP builds.
	if (validated.buildViaMcp && !process.env.LANGSMITH_API_KEY) {
		throw new Error(
			'--build-via-mcp requires LangSmith experiment tracking — set LANGSMITH_API_KEY. The no-LangSmith direct loop does not support MCP builds.',
		);
	}
	// Build knobs without --build-via-mcp would parse fine and then be silently
	// ignored — the run would look like it honored them. Fail loudly instead.
	if (!validated.buildViaMcp && raw.buildOnlyFlags.length > 0) {
		throw new Error(
			`${[...new Set(raw.buildOnlyFlags)].join(', ')} only take${raw.buildOnlyFlags.length === 1 ? 's' : ''} effect with --build-via-mcp — pass it, or drop the flag(s).`,
		);
	}
	if (validated.deletePrebuiltWorkflows && !validated.prebuiltWorkflows) {
		throw new Error('--delete-prebuilt-workflows requires --prebuilt-workflows');
	}
	if (validated.deletePrebuiltWorkflows && validated.keepWorkflows) {
		throw new Error('--delete-prebuilt-workflows cannot be used with --keep-workflows');
	}
	if (validated.source === 'langtracer' && !validated.suite) {
		throw new Error('--source langtracer requires --suite <slug>');
	}

	// In langtracer mode, default the dataset + baseline to a suite-scoped, eval-tagged
	// name so runs don't pollute the shared cohort and re-runs upsert one stable dataset.
	let dataset = validated.dataset;
	let datasetAutoForked = false;
	let baselinePrefix = validated.baselinePrefix;
	if (validated.source === 'langtracer' && validated.suite) {
		const suiteSlug = validated.suite
			.toLowerCase()
			.replace(/[^a-z0-9]+/g, '-')
			.replace(/^-+|-+$/g, '');

View on GitHub (pinned to 5ac6606e81)

Solutions

  1. Add --prebuilt-workflows <path-to-manifest.json> to the command.
  2. Remove --delete-prebuilt-workflows if you are not working with pre-built workflows.

Example fix

// before
pnpm eval:instance-ai --delete-prebuilt-workflows --base-url http://localhost:5678
// after
pnpm eval:instance-ai --prebuilt-workflows ./manifest.json --delete-prebuilt-workflows --base-url http://localhost:5678
Defensive patterns

Strategy: validation

Validate before calling

function validateDeleteRequiresPrebuilt(args: string[]): void {
  if (args.includes('--delete-prebuilt-workflows') && !args.includes('--prebuilt-workflows')) {
    throw new Error('--delete-prebuilt-workflows requires --prebuilt-workflows');
  }
}

Prevention

When it happens

Trigger: Invoking the eval CLI with `--delete-prebuilt-workflows` but no `--prebuilt-workflows <path>` argument. The check fires at args.ts:205 after the build-via-mcp checks.

Common situations: A developer removes or comments out the --prebuilt-workflows line in a script but leaves --delete-prebuilt-workflows. Or the flag is copy-pasted from a different run configuration that did include a manifest.

Related errors


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