How to upload multiple binary datas in one single item?

Describe the issue/error/question

Hello n8n community! I have a problem with attachments, I got several attachments from one single email message, so it is 2 or more attachments in one single item. How can I upload to google drive all of them? Otherwise I can upload only first attachment (I think probably because of Binary Data: attachment_0)

Please share the workflow

Output returned by the last node

Information on your n8n setup

  • n8n version: 0.186.1
  • Database you’re using: SQLite
  • Running n8n with the execution process: own
  • Running n8n via: Docker

Hi @shimaper, I think this workflow would do the job :). It’s also available in the templates section of your n8n instance.

Let me know if you have any questions on this.

I think it work for 1 single binary data (it is compressed file .zip) that contains several files. I tested it in mine workflow and it didn’t work

Maybe I shoudn’t use decompress node

Hey @shimaper, can you try using the Function node from the example workflow only? The first two nodes from the workflow just download some dummy data as explained in the sticky notes on the workflow, but you already have real data.

Check the input vs. output of the Function node:

1 item with file_0, file_1 goes in, multiple items each with one data property come out. You can then use the Google Drive node to upload this data object (make sure to enable the “Binary Data” switch).

Yes, I just checked with only function node, it works but in my situation I need more data from JSON for parents, name, id etc. so I need to implement my stuff and put it into JSON in this magic function node. Thank you for fast responding!

No worries at all! You can simply add more fields inside the json part of the snippet above as needed and can then read these in your Google Drive node (or any other nodes coming after your Function node). Give me a shout if you run into any trouble with this.