n8n-io/n8n · error · Error

The provided CSV file is empty

Error message

The provided CSV file is empty

What it means

Content error from loadTestCasesFromCsv. It fires when the CSV file exists but parseCsv returned zero rows — the file is empty or contains only blank lines (blank lines are skipped by the parser). Checked after parsing, before header detection.

Solutions

  1. Add prompt rows to the CSV file.
  2. Check you did not export an empty sheet or a file with only a BOM.
  3. Verify the file path — a different, empty file may have been read than intended.
Defensive patterns

Strategy: validation

When it happens

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

Appendix: source

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

		return rows.map((row) => row.map((cell) => cell ?? ''));
	} catch (error) {
		const message = error instanceof Error ? error.message : 'Unknown parsing error';
		throw new Error(`Failed to parse CSV file: ${message}`);
	}
}

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;

View on GitHub (pinned to 5ac6606e81)