Error: Missing pairedItem data

I have the following in a Code node - it creates a number of HTML links from a previous node - the output is then passed to a HTML node to be formatted. Later on, this HTML is added to the body of an Email node.

let htmlRows = "";

// called 'myNewField' to the JSON of each one
for (const item of $input.all()) {
  htmlRows += item.json.html;
}

return [{htmlRows:htmlRows}];

The HTML is generate fine and appears in the preview of the email node - but I get the error: Missing pairedItem data (node ‘Code’ probably didn’t supply it) when the email tries to send.

This was working fine in an older 0.2 install - I’m trying to migrate it to 1.20.0 which is where the error is.

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Hey @seank1968,

You may find this page handy: Item linking in the Code node | n8n Docs or this Item linking errors | n8n Docs

The code node would need to output the paired item index for each input as well so you can continue referencing data from earlier nodes.