{"record":{"id":"bc1c5fa89b39acba","repo":"n8n-io/n8n","slug":"missing-value-for-scenario","errorCode":null,"errorMessage":"Missing value for --scenario","messagePattern":"Missing value for --scenario","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/@n8n/instance-ai/evaluations/export-latest-verifier-request.ts","lineNumber":107,"sourceCode":"\t\t\t\tif (!slug) throw new Error(`Missing value for ${arg}`);\n\t\t\t\ttestCasePath = path.join(\n\t\t\t\t\tinstanceAiRoot,\n\t\t\t\t\t'evaluations',\n\t\t\t\t\t'data',\n\t\t\t\t\t'workflows',\n\t\t\t\t\t`${slug}.json`,\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase '--test-case-path': {\n\t\t\t\tconst rawPath = argv[++i];\n\t\t\t\tif (!rawPath) throw new Error('Missing value for --test-case-path');\n\t\t\t\ttestCasePath = path.resolve(process.cwd(), rawPath);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase '--scenario': {\n\t\t\t\tscenarioName = argv[++i];\n\t\t\t\tif (!scenarioName) throw new Error('Missing value for --scenario');\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault:\n\t\t\t\tif (arg.startsWith('--')) throw new Error(`Unknown flag: ${arg}`);\n\t\t\t\tif (!scenarioName) {\n\t\t\t\t\tscenarioName = arg;\n\t\t\t\t} else if (!testCasePath) {\n\t\t\t\t\ttestCasePath = path.join(\n\t\t\t\t\t\tinstanceAiRoot,\n\t\t\t\t\t\t'evaluations',\n\t\t\t\t\t\t'data',\n\t\t\t\t\t\t'workflows',\n\t\t\t\t\t\t`${arg}.json`,\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\tthrow new Error(`Unexpected positional argument: ${arg}`);\n\t\t\t\t}\n\t\t}","sourceCodeStart":89,"sourceCodeEnd":125,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/instance-ai/evaluations/export-latest-verifier-request.ts#L89-L125","documentation":"Thrown by `parseCliArgs()` in export-latest-verifier-request.ts when `--scenario` is the last token (the `argv[++i]` lookup returned undefined). `--scenario` selects which scenario within the test case to export; a test case may declare multiple scenarios and the exporter needs to know which one. There's also a positional fallback: the first bare token becomes the scenario name, so `--scenario` is only needed when you also want to pass a slug/flag-style second positional.","triggerScenarios":"`--scenario` as the last token. A script template that conditionally adds `--scenario` but didn't substitute the name. The user intended to pass the scenario name but pressed enter early.","commonSituations":"Running the exporter for a specific scenario in a multi-scenario case. CI matrix that iterates over scenario names and one iteration came up empty.","solutions":["Supply the scenario name: `--scenario \"cross-team report\"`.","Alternatively use the positional form: `node export-latest-verifier-request.ts <slug> <scenario-name>` (first positional is slug, second is scenario).","If you don't need a specific scenario, drop `--scenario` entirely (the exporter will use the default)."],"exampleFix":"// before\n$ node export-latest-verifier-request.ts --slug my-case --scenario\n// after\n$ node export-latest-verifier-request.ts --slug my-case --scenario \"cross-team report\"","handlingStrategy":"validation","validationCode":"// Covered by the same checkMissingValues helper.\n// For scenario specifically, you can also fall back to the second positional:\n//   node export.ts <slug> <scenario>","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use the positional `<slug> <scenario>` form to avoid value-flag pitfalls.","In CI matrices iterating scenario names, skip iterations where the name is empty rather than emitting a dangling flag."],"tags":["cli","argument-parsing","verifier-export","configuration","developer-error"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}