{"record":{"id":"9ae83a58c2e610c0","repo":"n8n-io/n8n","slug":"no-scenarios-found-in-args-testcasepath","errorCode":null,"errorMessage":"No scenarios found in ${args.testCasePath}","messagePattern":"No scenarios found in (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/@n8n/instance-ai/evaluations/export-latest-verifier-request.ts","lineNumber":324,"sourceCode":"\nfunction getSerializedTestCaseName(testCase: WorkflowTestCaseJson): string | undefined {\n\treturn getTestCasePrompt(testCase)?.slice(0, 70);\n}\n\nfunction getWorkflowJson(workflowId: string): WorkflowJson {\n\tconst row = querySqlite(\n\t\t`select json_object('nodes', json(nodes), 'connections', json(connections)) from workflow_entity where id='${workflowId}';`,\n\t);\n\tif (!row) throw new Error(`Workflow ${workflowId} not found in sqlite db`);\n\treturn jsonParse<WorkflowJson>(row);\n}\n\nfunction main(): void {\n\tconst args = parseCliArgs(process.argv.slice(2));\n\tconst testCase = readJson<WorkflowTestCaseJson>(args.testCasePath);\n\tconst scenarios = getScenarios(testCase);\n\tconst scenarioName = args.scenarioName ?? scenarios[0]?.name;\n\tif (!scenarioName) throw new Error(`No scenarios found in ${args.testCasePath}`);\n\tconst scenario = scenarios.find((item) => item.name === scenarioName);\n\tif (!scenario) throw new Error(`Scenario \"${scenarioName}\" not found in ${args.testCasePath}`);\n\tconst evalResults = readJson<StoredEvalResults<EvalResult>>(evalResultsPath);\n\tconst storedTestCase = findStoredTestCaseResult(\n\t\tevalResults,\n\t\targs.testCasePath,\n\t\tgetSerializedTestCaseName(testCase),\n\t);\n\tconst storedRun = findStoredVerifierRun(storedTestCase, scenarioName);\n\tif (!storedRun) {\n\t\tthrow new Error(\n\t\t\t`eval-results.json does not include a workflowId and evalResult for scenario \"${scenarioName}\" in test case \"${getSerializedTestCaseName(testCase) ?? args.testCasePath}\". Re-run the workflow evals with this branch.`,\n\t\t);\n\t}\n\n\tconst workflowJson = getWorkflowJson(storedRun.workflowId);\n\tconst checklist = [\n\t\t{","sourceCodeStart":306,"sourceCodeEnd":342,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/instance-ai/evaluations/export-latest-verifier-request.ts#L306-L342","documentation":"Thrown in main() when the parsed test-case JSON contains neither an `executionScenarios` array nor a legacy `scenarios` array, so getScenarios() returns []. The script needs at least one scenario to pick a successCriteria to build the verification artifact. This is a test-case fixture defect, not a runtime/environment issue.","triggerScenarios":"Loading a workflow test-case JSON that omits both `executionScenarios` and `scenarios`, or where the key is misspelled / present but set to null. The default test case (cross-team-linear-report.json) is expected to define them; a new or hand-edited fixture may not.","commonSituations":"Authoring a new test case and forgetting the scenario block; renaming the key during a schema migration; loading the wrong JSON file via --test-case-path.","solutions":["Open the test-case JSON and confirm it has an `executionScenarios` array with at least one { name, successCriteria } entry.","If using the legacy `scenarios` key, migrate it to `executionScenarios`.","Verify --test-case-path points at the intended fixture."],"exampleFix":"// before\n{\n  \"conversation\": [{ \"text\": \"build a report\" }]\n}\n// after\n{\n  \"conversation\": [{ \"text\": \"build a report\" }],\n  \"executionScenarios\": [\n    { \"name\": \"default\", \"successCriteria\": \"workflow executes and emits a report\" }\n  ]\n}","handlingStrategy":"validation","validationCode":"// Validate the fixture shape right after reading it.\nfunction assertHasScenarios(testCase: WorkflowTestCaseJson, filePath: string): Scenario[] {\n  const scenarios = testCase.executionScenarios ?? testCase.scenarios ?? [];\n  if (scenarios.length === 0) {\n    throw new Error(`No executionScenarios (or legacy scenarios) in ${filePath}; add at least one { name, successCriteria }.`);\n  }\n  return scenarios;\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Author test cases through the Zod schema so a missing scenario block fails at parse.","Keep a linter that checks every fixture under evaluations/data/workflows has a non-empty executionScenarios."],"tags":["config","test-case","schema","fixture"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}