{"record":{"id":"7a32d6499f21923f","repo":"Zie619/n8n-workflows","slug":"no-input-data-received","errorCode":null,"errorMessage":"No input data received","messagePattern":"No input data received","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"workflows/Telegram/1291_Telegram_Code_Automation_Webhook.json","lineNumber":81,"sourceCode":"        1040,\n        -40\n      ],\n      \"parameters\": {\n        \"jsonSchemaExample\": \"{\\n    \\\"title\\\": \\\"title\\\",\\n    \\\"content\\\": \\\"content\\\"\\n}\"\n      },\n      \"typeVersion\": 1.2,\n      \"notes\": \"This outputParserStructured node performs automated tasks as part of the workflow.\"\n    },\n    {\n      \"id\": \"1ec2e58e-c775-47ab-9544-7c21521741a1\",\n      \"name\": \"Separate Title & Content\",\n      \"type\": \"n8n-nodes-base.code\",\n      \"position\": [\n        1300,\n        -340\n      ],\n      \"parameters\": {\n        \"jsCode\": \"try {\\n  // Check if input exists and has the expected structure\\n  const input = $input.all();\\n  if (!input || !input.length) {\\n    throw new Error('No input data received');\\n  }\\n\\n  const firstItem = input[0];\\n  if (!firstItem || !firstItem.json || !firstItem.json.output || !firstItem.json.output.output) {\\n    throw new Error('Invalid input structure: missing required properties');\\n  }\\n\\n  const output = firstItem.json.output.output;\\n  \\n  // Validate title exists\\n  if (!output.title) {\\n    throw new Error('Missing title in output');\\n  }\\n\\n  // Validate content exists\\n  if (!output.content) {\\n    throw new Error('Missing content in output');\\n  }\\n\\n  const title = output.title;\\n  const content = output.content.replace(/<h1>.*?<\\\\/h1>/s, '').trim();\\n\\n  // Validate final content is not empty after processing\\n  if (!content) {\\n    throw new Error('Content is empty after processing');\\n  }\\n\\n  // console.log('Successfully processed content');\\n\\n  // console.log(title)\\n  // console.log(content)\\n  \\n  return { title, content };\\n\\n} catch (error) {\\n  // Log the error for debugging\\n  console.error('Error processing content:', error.message);\\n  \\n  // Return a graceful failure object\\n  return {\\n    error: true,\\n    message: error.message,\\n    title: '',\\n    content: '',\\n    timestamp: new Date().toISOString()\\n  };\\n}\"\n      },\n      \"typeVersion\": 2,\n      \"notes\": \"This code node performs automated tasks as part of the workflow.\"\n    },\n    {\n      \"id\": \"40f0ef7d-3c63-45ed-bbfb-8ed04772d214\",\n      \"name\": \"gpt-4o-mini1\",\n      \"type\": \"n8n-nodes-base.noOp\",\n      \"position\": [\n        1760,\n        260\n      ],\n      \"parameters\": {\n        \"model\": \"gpt-4o-mini-2024-07-18\",\n        \"options\": {\n          \"responseFormat\": \"json_object\"\n        }\n      },","sourceCodeStart":63,"sourceCodeEnd":99,"githubUrl":"https://github.com/Zie619/n8n-workflows/blob/94007c1445d9258a7da116646b79473e7c7c3282/workflows/Telegram/1291_Telegram_Code_Automation_Webhook.json#L63-L99","documentation":"Thrown by the 'Separate Title & Content' Code node when $input.all() returns an empty array — the upstream node (an agent/chain/output-parser feeding it) produced zero items. The node then expects input[0].json.output.output with title and content, strips the first <h1> from content, and returns {title, content}. Because upstream nodes have alwaysOutputData off, an empty LLM/agent response surfaces here as 'No input data received'.","triggerScenarios":"The AI agent node returned no output (API error swallowed, empty completion, output parser produced nothing), a preceding IF/filter passed zero items, or the chain node errored silently with continue-on-error.","commonSituations":"LLM provider outage or rate limit making the agent emit nothing, a structured-output parser failing to parse and returning no item, or a filter between the agent and this node removing all items. Note the outer catch swallows every error and returns {error:true, title:'', content:''} — so downstream nodes see a 'success' item unless they check .error.","solutions":["Check the execution history of the immediately preceding node: did it output items? Enable 'Always Output Data' on it if empty is possible but should still flow.","If the failure is legitimate, keep the graceful object but add an IF node right after that routes items with json.error to an error branch (e.g., Telegram notification) instead of publishing empty content.","For agent nodes, set onError/continue-fail so provider errors surface at the agent rather than vanishing before this node.","Re-run with the agent's input pinned to reproduce and inspect the raw model output."],"exampleFix":"// before\nconst input = $input.all();\nif (!input || !input.length) {\n  throw new Error('No input data received');\n}\n// ... later:\n} catch (error) {\n  console.error('Error processing content:', error.message);\n  return { error: true, message: error.message, title: '', content: '', timestamp: new Date().toISOString() };\n}\n\n// after - fail visibly instead of swallowing\nconst input = $input.all();\nif (!input || !input.length) {\n  throw new Error(`No input data received at Separate Title & Content (upstream: ${$('Upstream Node Name').all().length} items)`);\n}\n// remove the blanket catch, or rethrow after logging:\n} catch (error) {\n  console.error('Error processing content:', error.message);\n  throw error;\n}","handlingStrategy":"try-catch","validationCode":"const input = $input.all();\nif (!input.length) {\n  throw new Error(`No input data received. Upstream '${$('YourAgentNode').name}' items: ${$('YourAgentNode').all().length}`);\n}\nconst out = input[0].json?.output?.output;\nif (!out?.title || !out?.content) {\n  throw new Error(`Missing title/content in agent output. Keys: ${Object.keys(input[0].json).join(', ')}`);\n}","typeGuard":"const hasTitleContent = (o) =>\n  o != null && typeof o.title === 'string' && o.title.length > 0 &&\n  typeof o.content === 'string' && o.content.length > 0;","tryCatchPattern":"try {\n  const { title, content } = extractTitleContent($input.all());\n  return { title, content };\n} catch (e) {\n  // rethrow instead of returning {error:true,...}: downstream nodes cannot tell success from failure otherwise\n  throw new Error(`Separate Title & Content: ${e.message}`);\n}","preventionTips":["Enable 'Always Output Data' on agent/parser nodes only when an empty item is genuinely expected and handled downstream.","If you keep the graceful-error object pattern, add an IF node that routes json.error items to a notification branch.","Set agent nodes to stop-on-error so provider failures surface at the agent, not as empty input here."],"tags":["n8n","code-node","validation","ai-agent","empty-input","telegram"],"backgroundTag":null,"analyzedSha":"94007c1445d9258a7da116646b79473e7c7c3282","analyzedAt":"2026-08-15T04:10:37.591Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}