{"record":{"id":"e9d2110b7df3197a","repo":"n8n-io/n8n","slug":"build-via-mcp-is-incompatible-with-prebuilt-wo","errorCode":null,"errorMessage":"--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.","messagePattern":"--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\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/@n8n/instance-ai/evaluations/cli/args.ts","lineNumber":179,"sourceCode":"\tmcpServerName: z.string().min(1).default('n8n-local'),\n\tbuildModel: z.string().min(1).default('claude-opus-4-8'),\n\tbuildCwd: z.string().min(1).optional(),\n\tbuildMaxAttempts: z.number().int().positive().default(3),\n\tbuildMcpTimeoutMs: z.number().int().positive().default(120_000),\n\tbuildTimeoutMs: z.number().int().nonnegative().default(DEFAULT_MCP_BUILD_TIMEOUT_MS),\n});\n\n// ---------------------------------------------------------------------------\n// Public API\n// ---------------------------------------------------------------------------\n\nexport function parseCliArgs(argv: string[]): CliArgs {\n\tconst raw = parseRawArgs(argv);\n\tconst validated = cliArgsSchema.parse(raw);\n\t// --build-via-mcp checks first: they give clearer guidance than the generic\n\t// --delete-prebuilt-workflows check below when both are combined.\n\tif (validated.buildViaMcp && validated.prebuiltWorkflows) {\n\t\tthrow new Error(\n\t\t\t'--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.',\n\t\t);\n\t}\n\tif (validated.buildViaMcp && validated.deletePrebuiltWorkflows) {\n\t\tthrow new Error(\n\t\t\t'--delete-prebuilt-workflows applies to --prebuilt-workflows. --build-via-mcp already cleans up the workflows it builds unless --keep-workflows is set.',\n\t\t);\n\t}\n\t// MCP builds are LangSmith-only: the keyless direct loop parallelizes\n\t// iterations without the lane allocator, so its 4-per-lane build cap applies\n\t// PER ITERATION — concurrent `claude` sessions would scale with\n\t// lanes × iterations × 4 and flood the shared Anthropic budget. Fail fast\n\t// instead of teaching the direct loop (tech debt slated for removal) MCP builds.\n\tif (validated.buildViaMcp && !process.env.LANGSMITH_API_KEY) {\n\t\tthrow new Error(\n\t\t\t'--build-via-mcp requires LangSmith experiment tracking — set LANGSMITH_API_KEY. The no-LangSmith direct loop does not support MCP builds.',\n\t\t);\n\t}","sourceCodeStart":161,"sourceCodeEnd":197,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/instance-ai/evaluations/cli/args.ts#L161-L197","documentation":"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.","triggerScenarios":"Thrown at packages/@n8n/instance-ai/evaluations/cli/args.ts:179 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}