n8n-io/n8n · error · Error

Missing value for ${arg}

Error message

Missing value for ${arg}

What it means

Thrown by `parseCliArgs()` in export-latest-verifier-request.ts when `--test-case` or `--slug` is the last token on the command line (the `argv[++i]` lookup returned undefined). This CLI is the one that exports the latest verifier request payload; `--test-case`/`--slug` take a slug that gets joined to `evaluations/data/workflows/<slug>.json`. Distinct from the computer-use CLI's 'Missing value' (which also rejects a following `--`); this parser only checks for absence.

Source

Thrown at packages/@n8n/instance-ai/evaluations/export-latest-verifier-request.ts:89

const evalResultsPath = path.join(instanceAiRoot, 'eval-results.json');
const sqliteDbPath = path.join(repoRoot, '.n8n-instance-ai', '.n8n', 'database.sqlite');

type CliArgs = {
	testCasePath: string;
	scenarioName?: string;
};

function parseCliArgs(argv: string[]): CliArgs {
	let testCasePath: string | undefined;
	let scenarioName: string | undefined;

	for (let i = 0; i < argv.length; i++) {
		const arg = argv[i];
		switch (arg) {
			case '--test-case':
			case '--slug': {
				const slug = argv[++i];
				if (!slug) throw new Error(`Missing value for ${arg}`);
				testCasePath = path.join(
					instanceAiRoot,
					'evaluations',
					'data',
					'workflows',
					`${slug}.json`,
				);
				break;
			}
			case '--test-case-path': {
				const rawPath = argv[++i];
				if (!rawPath) throw new Error('Missing value for --test-case-path');
				testCasePath = path.resolve(process.cwd(), rawPath);
				break;
			}
			case '--scenario': {
				scenarioName = argv[++i];
				if (!scenarioName) throw new Error('Missing value for --scenario');

View on GitHub (pinned to 5ac6606e81)

Solutions

  1. Supply the slug immediately after the flag: `--slug cross-team-linear-report`.
  2. If the slug came from an env var, ensure it's set and non-empty before invoking.
  3. Use the positional form instead: `node export-latest-verifier-request.ts <slug>` (the parser accepts a bare slug as test-case when no `--scenario` was set).

Example fix

// before
$ node export-latest-verifier-request.ts --slug
// after
$ node export-latest-verifier-request.ts --slug cross-team-linear-report
Defensive patterns

Strategy: validation

Validate before calling

const VALUE_FLAGS = new Set(['--test-case','--slug','--test-case-path','--scenario']);
function checkMissingValues(argv: string[]): string[] {
  const missing: string[] = [];
  for (let i = 0; i < argv.length; i++) {
    if (VALUE_FLAGS.has(argv[i]) && argv[i + 1] === undefined) missing.push(argv[i]);
  }
  return missing;
}

Prevention

When it happens

Trigger: `--slug` with no following token. A shell-interpolated `${SLUG}` that resolved to empty. The flag was the last token because the rest of the line was truncated.

Common situations: CI script forgetting to set the slug env var. Copy-pasting a partial command. A wrapper that conditionally includes `--slug` but forgets the value when the condition is true.

Related errors


AI-assisted analysis of n8n-io/n8n@5ac6606e81 (2026-08-12). Data as JSON: /api/errors/763c9a49ff13fadd. Report an issue: GitHub.