Upload multiple attachments from GMail to Google Drive

Hello!

I’m trying to build the following flow:

  1. Get messages from the inbox of a GMail account
  2. Upload all the attachments in each message to a folder Google Drive
  3. Generate a public link for each attachment
  4. Add the details to a Google Sheets document

Everything works fine with only 1 attachment, my flow only takes attachment_0

But, if a message have multiple attachments, how can I get all the attachments?

Hi @Mike_M, welcome to the community!

There currently is no built-in logic for handling multiple binary items with different names (such as attachment_0, attachment_1, etc.). However, what you could do is convert your single item with multiple attachments into multiple items with one predictable attachment each. An example workflow demonstrating the idea is available at Split Out Binary Data | n8n workflow template.

After converting your data as shown above you can then simply have your Google Drive node upload the data binary property of each individual item.

Has there been an update on saving multiple Gmail attachments to Drive?