{"record":{"id":"0076dddbf203ff98","repo":"n8n-io/n8n","slug":"a-non-empty-prompt-is-required-0076dd","errorCode":null,"errorMessage":"A non-empty prompt is required.","messagePattern":"A non-empty prompt is required\\.","errorType":"exception","errorClass":"NodeOperationError","httpStatus":null,"severity":"error","filePath":"packages/@n8n/nodes-langchain/nodes/vendors/GoogleGemini/actions/video/generate.operation.ts","lineNumber":134,"sourceCode":"\t\t\t},\n\t\t],\n\t},\n];\n\nconst displayOptions = {\n\tshow: {\n\t\toperation: ['generate'],\n\t\tresource: ['video'],\n\t},\n};\n\nexport const description = updateDisplayOptions(displayOptions, properties);\n\nexport async function execute(this: IExecuteFunctions, i: number): Promise<INodeExecutionData[]> {\n\tconst model = this.getNodeParameter('modelId', i, '', { extractValue: true }) as string;\n\tconst prompt = this.getNodeParameter('prompt', i, '') as string;\n\tif (!prompt.trim()) {\n\t\tthrow new NodeOperationError(this.getNode(), 'A non-empty prompt is required.', {\n\t\t\titemIndex: i,\n\t\t});\n\t}\n\tconst returnAs = this.getNodeParameter('returnAs', i, 'video');\n\tconst options = this.getNodeParameter('options', i, {});\n\tconst binaryPropertyOutput = this.getNodeParameter(\n\t\t'options.binaryPropertyOutput',\n\t\ti,\n\t\t'data',\n\t) as string;\n\tconst credentials = await this.getCredentials('googlePalmApi');\n\n\tif (!model.includes('veo')) {\n\t\tthrow new NodeOperationError(\n\t\t\tthis.getNode(),\n\t\t\t`Model ${model} is not supported for video generation. Please use a Veo model`,\n\t\t\t{\n\t\t\t\tdescription: 'Video generation is only supported by Veo models',","sourceCodeStart":116,"sourceCodeEnd":152,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/nodes-langchain/nodes/vendors/GoogleGemini/actions/video/generate.operation.ts#L116-L152","documentation":"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.","triggerScenarios":"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).","commonSituations":"Test run with no prompt typed; upstream node didn't emit the expected field; an optional prompt branch left blank.","solutions":["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').","Validate the source field exists upstream (Set / Edit Fields) and default it to a sensible prompt.","Drop empty items before this node so the guard never fires."],"exampleFix":"// before\nconst prompt = '';\n\n// after\nconst prompt = 'A neon city at night, cinematic, 5s';","handlingStrategy":"validation","validationCode":"const prompt = String(this.getNodeParameter('prompt', i, '')).trim();\nif (!prompt) {\n  throw new Error('Veo video generation requires a non-empty prompt');\n}","typeGuard":"function isNonEmptyPrompt(p: unknown): p is string {\n  return typeof p === 'string' && p.trim().length > 0;\n}","tryCatchPattern":null,"preventionTips":["Provide a default prompt in the node field.","Coerce expression sources: ($json.prompt ?? '').trim() || 'A cinematic landscape'.","Validate upstream with an IF/Switch node to skip empty-prompt items."],"tags":["google-gemini","video-generation","veo","prompt","validation","empty-input","node-operation-error"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}