{"record":{"id":"1c697f6baadcd442","repo":"n8n-io/n8n","slug":"no-prompt-rows-found-in-the-provided-csv-file","errorCode":null,"errorMessage":"No prompt rows found in the provided CSV file","messagePattern":"No prompt rows found in the provided CSV file","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/@n8n/ai-workflow-builder.ee/evaluations/cli/csv-prompt-loader.ts","lineNumber":60,"sourceCode":"export function loadTestCasesFromCsv(csvPath: string): TestCase[] {\n\tconst resolvedPath = isAbsolute(csvPath) ? csvPath : resolve(process.cwd(), csvPath);\n\n\tif (!existsSync(resolvedPath)) {\n\t\tthrow new Error(`CSV file not found at ${resolvedPath}`);\n\t}\n\n\tconst rows = parseCsv(readFileSync(resolvedPath, 'utf8'));\n\n\tif (rows.length === 0) {\n\t\tthrow new Error('The provided CSV file is empty');\n\t}\n\n\tconst hasHeader = isHeaderRow(rows[0]);\n\tconst header = hasHeader ? rows[0] : undefined;\n\tconst dataRows = hasHeader ? rows.slice(1) : rows;\n\n\tif (dataRows.length === 0) {\n\t\tthrow new Error('No prompt rows found in the provided CSV file');\n\t}\n\n\t// Find column index by name(s), returns undefined if no header\n\tconst findColumn = (...names: string[]): number | undefined => {\n\t\tif (!header) return undefined;\n\t\tfor (const name of names) {\n\t\t\tconst idx = detectColumnIndex(header, name);\n\t\t\tif (idx !== undefined) return idx;\n\t\t}\n\t\treturn undefined;\n\t};\n\n\tconst promptIdx = findColumn('prompt') ?? 0;\n\tconst idIdx = findColumn('id');\n\tconst dosIdx = findColumn('dos', 'do');\n\tconst dontsIdx = findColumn('donts', 'dont');\n\tconst annotationsIdx = findColumn('annotations');\n","sourceCodeStart":42,"sourceCodeEnd":78,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/ai-workflow-builder.ee/evaluations/cli/csv-prompt-loader.ts#L42-L78","documentation":"Content error from loadTestCasesFromCsv. It fires when the CSV has rows but, after detecting and stripping an optional header row, zero data rows remain — i.e. the file contains only a header. Distinguishes a header-only file from a truly empty one.","triggerScenarios":"Thrown at packages/@n8n/ai-workflow-builder.ee/evaluations/cli/csv-prompt-loader.ts:60 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add at least one data row below the header row.","If the file has no header, make sure the first row is a prompt, not a header-like row (header detection would consume it).","Check the expected columns: prompt, plus optional dos/donts/annotations."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","contentChangedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}