n8n-io/n8n · error · Error

--build-via-mcp is incompatible with --prebuilt-workflows. -

Error message

--build-via-mcp is incompatible with --prebuilt-workflows. --build-via-mcp builds fresh workflows via the MCP server on each lane; --prebuilt-workflows verifies existing ones.

What it means

Error "--build-via-mcp is incompatible with --prebuilt-workflows. --build-via-mcp builds fresh workflows via the MCP server on each lane; --prebuilt-workflows verifies existing ones." thrown in n8n-io/n8n.

Source

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

	mcpServerName: z.string().min(1).default('n8n-local'),
	buildModel: z.string().min(1).default('claude-opus-4-8'),
	buildCwd: z.string().min(1).optional(),
	buildMaxAttempts: z.number().int().positive().default(3),
	buildMcpTimeoutMs: z.number().int().positive().default(120_000),
	buildTimeoutMs: z.number().int().nonnegative().default(DEFAULT_MCP_BUILD_TIMEOUT_MS),
});

// ---------------------------------------------------------------------------
// Public API
// ---------------------------------------------------------------------------

export function parseCliArgs(argv: string[]): CliArgs {
	const raw = parseRawArgs(argv);
	const validated = cliArgsSchema.parse(raw);
	// --build-via-mcp checks first: they give clearer guidance than the generic
	// --delete-prebuilt-workflows check below when both are combined.
	if (validated.buildViaMcp && validated.prebuiltWorkflows) {
		throw new Error(
			'--build-via-mcp is incompatible with --prebuilt-workflows. --build-via-mcp builds fresh workflows via the MCP server on each lane; --prebuilt-workflows verifies existing ones.',
		);
	}
	if (validated.buildViaMcp && validated.deletePrebuiltWorkflows) {
		throw new Error(
			'--delete-prebuilt-workflows applies to --prebuilt-workflows. --build-via-mcp already cleans up the workflows it builds unless --keep-workflows is set.',
		);
	}
	// 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.',
		);
	}

View on GitHub (pinned to 5ac6606e81)

When it happens

Trigger: Thrown at packages/@n8n/instance-ai/evaluations/cli/args.ts:179 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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