Zie619/n8n-workflows · error · Error
The video ID parameter is empty.
Error message
The video ID parameter is empty.
What it means
Thrown by 'Get YouTube Transcript' (workflow 1463). It loops over $input.all() and throws when an item's json.VIDEO_ID is falsy — the key is absent, undefined, null, or empty string. Note the asymmetry: a present-but-wrong ID does not throw here; it is caught and returned as an error field, so this message strictly means 'the VIDEO_ID field itself is missing/empty'.
Source
Thrown at workflows/Splitout/1463_Splitout_Code_Automate_Webhook.json:33
"name": "⚡📽️ Ultimate AI-Powered Chatbot for YouTube Summarization & Analysis",
"tags": [
"automation",
"n8n",
"production-ready",
"excellent",
"optimized"
],
"nodes": [
{
"id": "10cfb27f-ef93-41cd-972e-37dfdcab97ad",
"name": "Get YouTube Transcript",
"type": "n8n-nodes-base.code",
"position": [
20,
360
],
"parameters": {
"jsCode": "// Get all input items\nconst items = $input.all();\nconst results = [];\n\n// Import the YoutubeTranscript module from the youtube-transcript package\n// npm i -g youtube-transcript\nconst { YoutubeTranscript } = require('youtube-transcript');\n\nfor (let i = 0; i < items.length; i++) {\n // Extract the VIDEO_ID from the input JSON\n const VIDEO_ID = items[i].json.VIDEO_ID;\n \n if (!VIDEO_ID) {\n throw new Error('The video ID parameter is empty.');\n }\n \n try {\n // Fetch the transcript for the provided video ID\n const transcript = await YoutubeTranscript.fetchTranscript(VIDEO_ID);\n \n // Append the fetched transcript data to the results\n results.push({\n json: {\n youtubeId: VIDEO_ID,\n transcript,\n },\n });\n } catch (error) {\n // In case of an error, add an error message to the output for this item\n results.push({\n json: {\n youtubeId: VIDEO_ID,\n error: error.message,\n },\n });\n }\n}\n\n// Return the results to be used by the next node in the workflow\nreturn results;\n"
},
"typeVersion": 2,
"notes": "This code node performs automated tasks as part of the workflow."
},
{
"id": "a7b7740e-7470-4ce0-a698-6043559eb781",
"name": "When Executed by Another Workflow",
"type": "n8n-nodes-base.executeWorkflowTrigger",
"position": [
-580,
180
],
"parameters": {
"inputSource": "jsonExample",
"jsonExample": "{\n \"query\": {\n\t\"videoId\": \"YouTube video id\"\n }\n}"
},
"typeVersion": 1.1,
"notes": "This executeWorkflowTrigger node performs automated tasks as part of the workflow."View on GitHub (pinned to 94007c1445)
Solutions
- Check what the parent workflow sends to the executeWorkflowTrigger and align the key to VIDEO_ID (see exampleFix).
- Normalize common variants before validating: videoId, video_id, or extracting the ID from a URL.
- Skip or report bad items instead of throwing so one missing ID does not kill the batch.
- Pin a sample trigger payload containing VIDEO_ID for local testing.
Example fix
// before
const VIDEO_ID = items[i].json.VIDEO_ID;
if (!VIDEO_ID) {
throw new Error('The video ID parameter is empty.');
}
// after
const j = items[i].json;
let VIDEO_ID = j.VIDEO_ID || j.videoId || j.video_id || '';
if (!VIDEO_ID && typeof j.url === 'string') {
VIDEO_ID = (j.url.match(/(?:v=|youtu\.be\/|shorts\/)([\w-]{11})/) || [])[1] || '';
}
if (!VIDEO_ID) {
results.push({ json: { error: 'The video ID parameter is empty.', index: i } });
continue;
} Defensive patterns
Strategy: validation
Validate before calling
const j = items[i].json;
let VIDEO_ID = j.VIDEO_ID || j.videoId || j.video_id || '';
if (!VIDEO_ID && typeof j.url === 'string') {
VIDEO_ID = (j.url.match(/(?:v=|youtu\.be\/|shorts\/)([\w-]{11})/) || [])[1] || '';
}
if (!VIDEO_ID) { results.push({ json: { error: 'video ID empty', index: i } }); continue; } Type guard
function isYoutubeId(v) {
return typeof v === 'string' && /^[\w-]{11}$/.test(v);
} Prevention
- Agree on one payload schema (VIDEO_ID) between calling and sub-workflows, and pin a sample payload.
- Accept common variants (videoId, video_id, full URL) and normalize in one place.
- Push per-item errors into results instead of throwing so one bad ID does not kill a batch.
When it happens
Trigger: The 'When Executed by Another Workflow' executeWorkflowTrigger received a payload without VIDEO_ID — the calling workflow passes a differently-named key (videoId, video_id, url) or an empty value. Because the throw is inside the loop, the first item missing the field aborts the run even if later items are fine.
Common situations: Parent workflow's payload schema drifted from this sub-workflow (videoId vs VIDEO_ID); caller passing a full YouTube URL where the child expects the bare 11-char ID; a test execution with no input data; items coming from a form/upload where the field was optional.
Related errors
- 'llm_index' is udefined or not a valid integer
- Input text is empty
- No EDI message found in input. Please provide the EDI messag
- Input text is empty
- monthly_searches data is missing or not an array from Loop O
AI-assisted analysis of Zie619/n8n-workflows@94007c1445 (2026-08-15).
Data as JSON: /api/errors/6e409780c9dce7c6.
Report an issue: GitHub.