Send several attachments in email, pairedItem error

I’m trying to send an email with several attachments, but I’m getting a ‘pairedItem’ error.

I followed the guidelines in this discussion Cant send Email with multiple attachments :( - #4 by Robert

Missing pairedItem data (node ‘Code2’ probably didn’t supply it)

Information on your n8n setup

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

Hi @Diego_W :wave: Welcome to the community :tada:

Could you also share your whole workflow here, just so we can get an idea of the bigger picture and how you’re pulling in your data? You can just hit cmd/ctrl a + cmd/ctrl + c on the workflow editor, and then paste that here on the forums between two sets of three backticks (```).

Could you also share the following:

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

hello, here’s the n8n workflow I’m working on

Thanks for that, @Diego_W :+1:

Taking a closer look, you’re not manually adding in the ability to use linked/paired items in your code node - expressions like .item won’t work in this case. I know it’s the default when you use the drag and drop, which might have led you a little astray :see_no_evil:

Take a peek at this doc, it should help you out with this: Item linking in the Code node | n8n Docs

So you have two solutions here - include linked items in your custom code, or have the code node return everything required in the email node (which means you wouldn’t read from anything before the code node if you do this).

I read the material, but I still don’t know how to include linked items, as it is binary data.

Could you give me an example of how I would do this using the flow code node?

and is the problem in the code node named Code or in the Code2 node?

Thank you for your attention.

Taking a peek, you might want to change this across both the Code and Code 2 nodes - it looks like you’re getting your binary data through the HTTP Request node, correct? In that case you can use something like {{ $('HTTP Request').item.binary.dataR }} to access it in your node labelled Code, and do the same but with the Code node output in Code 2 as it looks like it renames the files for you. Let me know if that helps!


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.