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'.

Solutions

  1. Check what the parent workflow sends to the executeWorkflowTrigger and align the key to VIDEO_ID (see exampleFix).
  2. Normalize common variants before validating: videoId, video_id, or extracting the ID from a URL.
  3. Skip or report bad items instead of throwing so one missing ID does not kill the batch.
  4. 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

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


AI-assisted analysis of Zie619/n8n-workflows@94007c1445 (2026-08-15). Data as JSON: /api/errors/6e409780c9dce7c6. Report an issue: GitHub.

Appendix: 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)