Zie619/n8n-workflows · error · Error

No input data received

Error message

No input data received

What it means

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

Source

Thrown at workflows/Telegram/1291_Telegram_Code_Automation_Webhook.json:81

        1040,
        -40
      ],
      "parameters": {
        "jsonSchemaExample": "{\n    \"title\": \"title\",\n    \"content\": \"content\"\n}"
      },
      "typeVersion": 1.2,
      "notes": "This outputParserStructured node performs automated tasks as part of the workflow."
    },
    {
      "id": "1ec2e58e-c775-47ab-9544-7c21521741a1",
      "name": "Separate Title & Content",
      "type": "n8n-nodes-base.code",
      "position": [
        1300,
        -340
      ],
      "parameters": {
        "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}"
      },
      "typeVersion": 2,
      "notes": "This code node performs automated tasks as part of the workflow."
    },
    {
      "id": "40f0ef7d-3c63-45ed-bbfb-8ed04772d214",
      "name": "gpt-4o-mini1",
      "type": "n8n-nodes-base.noOp",
      "position": [
        1760,
        260
      ],
      "parameters": {
        "model": "gpt-4o-mini-2024-07-18",
        "options": {
          "responseFormat": "json_object"
        }
      },

View on GitHub (pinned to 94007c1445)

Solutions

  1. 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.
  2. 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.
  3. For agent nodes, set onError/continue-fail so provider errors surface at the agent rather than vanishing before this node.
  4. Re-run with the agent's input pinned to reproduce and inspect the raw model output.

Example fix

// before
const input = $input.all();
if (!input || !input.length) {
  throw new Error('No input data received');
}
// ... later:
} catch (error) {
  console.error('Error processing content:', error.message);
  return { error: true, message: error.message, title: '', content: '', timestamp: new Date().toISOString() };
}

// after - fail visibly instead of swallowing
const input = $input.all();
if (!input || !input.length) {
  throw new Error(`No input data received at Separate Title & Content (upstream: ${$('Upstream Node Name').all().length} items)`);
}
// remove the blanket catch, or rethrow after logging:
} catch (error) {
  console.error('Error processing content:', error.message);
  throw error;
}
Defensive patterns

Strategy: try-catch

Validate before calling

const input = $input.all();
if (!input.length) {
  throw new Error(`No input data received. Upstream '${$('YourAgentNode').name}' items: ${$('YourAgentNode').all().length}`);
}
const out = input[0].json?.output?.output;
if (!out?.title || !out?.content) {
  throw new Error(`Missing title/content in agent output. Keys: ${Object.keys(input[0].json).join(', ')}`);
}

Type guard

const hasTitleContent = (o) =>
  o != null && typeof o.title === 'string' && o.title.length > 0 &&
  typeof o.content === 'string' && o.content.length > 0;

Try / catch

try {
  const { title, content } = extractTitleContent($input.all());
  return { title, content };
} catch (e) {
  // rethrow instead of returning {error:true,...}: downstream nodes cannot tell success from failure otherwise
  throw new Error(`Separate Title & Content: ${e.message}`);
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


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