n8n-io/n8n · error · NodeOperationError

A non-empty prompt is required.

Error message

A non-empty prompt is required.

What it means

First guard in the Gemini 'video / generate' execute(): reads the 'prompt' parameter and, if it trims to empty, throws before contacting the Veo API. Identical contract to the image/text prompt guards — Veo requires a non-empty prompt.

Source

Thrown at packages/@n8n/nodes-langchain/nodes/vendors/GoogleGemini/actions/video/generate.operation.ts:134

			},
		],
	},
];

const displayOptions = {
	show: {
		operation: ['generate'],
		resource: ['video'],
	},
};

export const description = updateDisplayOptions(displayOptions, properties);

export async function execute(this: IExecuteFunctions, i: number): Promise<INodeExecutionData[]> {
	const model = this.getNodeParameter('modelId', i, '', { extractValue: true }) as string;
	const prompt = this.getNodeParameter('prompt', i, '') as string;
	if (!prompt.trim()) {
		throw new NodeOperationError(this.getNode(), 'A non-empty prompt is required.', {
			itemIndex: i,
		});
	}
	const returnAs = this.getNodeParameter('returnAs', i, 'video');
	const options = this.getNodeParameter('options', i, {});
	const binaryPropertyOutput = this.getNodeParameter(
		'options.binaryPropertyOutput',
		i,
		'data',
	) as string;
	const credentials = await this.getCredentials('googlePalmApi');

	if (!model.includes('veo')) {
		throw new NodeOperationError(
			this.getNode(),
			`Model ${model} is not supported for video generation. Please use a Veo model`,
			{
				description: 'Video generation is only supported by Veo models',

View on GitHub (pinned to 5ac6606e81)

Solutions

  1. Type a non-empty Prompt in the node, or ensure the expression feeding it returns text (e.g. ($json.prompt ?? '').trim() || 'A cinematic shot of a city at dawn').
  2. Validate the source field exists upstream (Set / Edit Fields) and default it to a sensible prompt.
  3. Drop empty items before this node so the guard never fires.

Example fix

// before
const prompt = '';

// after
const prompt = 'A neon city at night, cinematic, 5s';
Defensive patterns

Strategy: validation

Validate before calling

const prompt = String(this.getNodeParameter('prompt', i, '')).trim();
if (!prompt) {
  throw new Error('Veo video generation requires a non-empty prompt');
}

Type guard

function isNonEmptyPrompt(p: unknown): p is string {
  return typeof p === 'string' && p.trim().length > 0;
}

Prevention

When it happens

Trigger: The Prompt field is empty, contains only whitespace, or is wired to an expression that resolves to '' / undefined for the current item (e.g. $json.prompt where the upstream field is absent).

Common situations: Test run with no prompt typed; upstream node didn't emit the expected field; an optional prompt branch left blank.

Related errors


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