n8n-io/n8n · error · Error

Unknown flag: ${arg}

Error message

Unknown flag: ${arg}

What it means

Thrown by `parseCliArgs()` in export-latest-verifier-request.ts when an argv token starts with `--` but matches no case in the switch. This exporter CLI accepts a smaller flag set than the computer-use CLI: `--test-case`/`--slug`, `--test-case-path`, and `--scenario`. Any other `--token` is rejected. Distinct from error 420 which is the equivalent guard in a different CLI with a different accepted-flag set.

Source

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

					'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');
				break;
			}
			default:
				if (arg.startsWith('--')) throw new Error(`Unknown flag: ${arg}`);
				if (!scenarioName) {
					scenarioName = arg;
				} else if (!testCasePath) {
					testCasePath = path.join(
						instanceAiRoot,
						'evaluations',
						'data',
						'workflows',
						`${arg}.json`,
					);
				} else {
					throw new Error(`Unexpected positional argument: ${arg}`);
				}
		}
	}

	return {
		testCasePath:

View on GitHub (pinned to 5ac6606e81)

Solutions

  1. Inspect the accepted flag set (parseCliArgs switch at export-latest-verifier-request.ts:85-109) and remove or correct the offending token.
  2. If you meant to select a test case by slug, use `--slug <slug>` or `--test-case <slug>` or the first positional.
  3. If you meant to point at a path, use `--test-case-path <path>`.
  4. If you meant to select a scenario, use `--scenario <name>` or the second positional.

Example fix

// before
$ node export-latest-verifier-request.ts --filter slack
// after
$ node export-latest-verifier-request.ts --slug slack
Defensive patterns

Strategy: validation

Validate before calling

const ACCEPTED = new Set(['--test-case','--slug','--test-case-path','--scenario']);
function findUnknownFlags(argv: string[]): string[] {
  return argv.filter((a) => a.startsWith('--') && !ACCEPTED.has(a));
}
const unknown = findUnknownFlags(process.argv.slice(2));
if (unknown.length) throw new Error(`Unknown flags: ${unknown.join(', ')}`);

Prevention

When it happens

Trigger: Pass a computer-use CLI flag here by mistake (e.g. `--base-url`, `--filter`, `--verbose` — none are accepted). Typo a flag (`--scneario`). Carry over a flag from docs for a different eval tool. Pass `--help` (not implemented).

Common situations: Developers confuse the three eval CLIs and reuse flags across them. Copy-paste from a README for the wrong tool. A wrapper script shared across tools that injects a flag not understood by this one.

Related errors


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