n8n-io/n8n · error · Error

No prompt rows found in the provided CSV file

Error message

No prompt rows found in the provided CSV file

What it means

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.

Solutions

  1. Add at least one data row below the header row.
  2. If the file has no header, make sure the first row is a prompt, not a header-like row (header detection would consume it).
  3. Check the expected columns: prompt, plus optional dos/donts/annotations.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at packages/@n8n/ai-workflow-builder.ee/evaluations/cli/csv-prompt-loader.ts:60 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/1c697f6baadcd442. Report an issue: GitHub.

Appendix: source

Thrown at packages/@n8n/ai-workflow-builder.ee/evaluations/cli/csv-prompt-loader.ts:60

export function loadTestCasesFromCsv(csvPath: string): TestCase[] {
	const resolvedPath = isAbsolute(csvPath) ? csvPath : resolve(process.cwd(), csvPath);

	if (!existsSync(resolvedPath)) {
		throw new Error(`CSV file not found at ${resolvedPath}`);
	}

	const rows = parseCsv(readFileSync(resolvedPath, 'utf8'));

	if (rows.length === 0) {
		throw new Error('The provided CSV file is empty');
	}

	const hasHeader = isHeaderRow(rows[0]);
	const header = hasHeader ? rows[0] : undefined;
	const dataRows = hasHeader ? rows.slice(1) : rows;

	if (dataRows.length === 0) {
		throw new Error('No prompt rows found in the provided CSV file');
	}

	// Find column index by name(s), returns undefined if no header
	const findColumn = (...names: string[]): number | undefined => {
		if (!header) return undefined;
		for (const name of names) {
			const idx = detectColumnIndex(header, name);
			if (idx !== undefined) return idx;
		}
		return undefined;
	};

	const promptIdx = findColumn('prompt') ?? 0;
	const idIdx = findColumn('id');
	const dosIdx = findColumn('dos', 'do');
	const dontsIdx = findColumn('donts', 'dont');
	const annotationsIdx = findColumn('annotations');

View on GitHub (pinned to 5ac6606e81)