n8n-io/n8n · error · Error

Python script produced no output. stderr

Error message

Python script produced no output. stderr: ${stderr || 'none'}. Command: uvx ${args.join(' ')}

What it means

The workflow-similarity evaluator shelled out to a Python script via `uvx` and the process finished without any stdout. The wrapper tolerates non-zero exit codes when stdout still carries valid JSON, so this error fires only when stdout is completely empty — the script crashed before printing, the uvx environment failed to resolve, or the wrong args were passed. stderr (or 'none') and the exact command are embedded for diagnosis.

Solutions

  1. Inspect the embedded stderr to find the actual Python failure (import error, traceback, or uvx resolution failure)
  2. Run the printed `uvx <args>` command manually to reproduce the failure outside the evaluator
  3. Verify uvx is installed and on PATH, and that the referenced Python package/script version still exists
  4. If the script legitimately exits non-zero on low similarity, ensure it still prints its JSON result to stdout before exiting
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at packages/@n8n/ai-workflow-builder.ee/evaluations/programmatic/evaluators/workflow-similarity.ts:161 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/99269f93e8185287. Report an issue: GitHub.

Appendix: source

Thrown at packages/@n8n/ai-workflow-builder.ee/evaluations/programmatic/evaluators/workflow-similarity.ts:161

			stdout = result.stdout;
			stderr = result.stderr;
		} catch (execError) {
			// Python script may exit with non-zero code if similarity is below threshold
			// But it still outputs valid JSON, so we should use it
			if (isExecError(execError)) {
				stdout = execError.stdout ?? '';
				stderr = execError.stderr ?? '';
			}

			// Only throw if we don't have valid output
			if (!stdout || stdout.trim() === '') {
				throw execError;
			}
		}

		// Check if stdout is empty
		if (!stdout || stdout.trim() === '') {
			throw new Error(
				`Python script produced no output. stderr: ${stderr || 'none'}. Command: uvx ${args.join(' ')}`,
			);
		}

		// Parse result
		const parsed: unknown = JSON.parse(stdout);

		if (!isWorkflowSimilarityResult(parsed)) {
			throw new Error(
				`Invalid response from Python script. Expected WorkflowSimilarityResult shape but got: ${stdout.slice(0, 200)}`,
			);
		}

		// Convert Python result to SingleEvaluatorResult format
		const violations = parsed.top_edits.map((edit) => ({
			name: mapEditTypeToViolationName(edit.type),
			type: edit.priority,
			description: edit.description,

View on GitHub (pinned to 5ac6606e81)