Upload Gmail attachement into Gdrive

Hello :waving_hand:

I try to create a very simple workflow by uploading Gmail attachement into Gdrive but I do not succeed. When I have only these 2 nodes, no problem.

The problem

When I had extra nodes between them, with more inputs, it doesn’t work anymore. How to deal with binary and other inputs ?

Thanks for helping :folded_hands:

Error message

Problem in node ‘Google Drive - Upload‘

This operation expects the node's input data to contain a binary file 'attachment_0', but none was found [item 0]

My workflow

Information on n8n setup

  • n8n version: 1.94.1
  • Database (default: SQLite): (I don’t know)
  • n8n EXECUTIONS_PROCESS setting (default: own, main): (I don’t know)
  • Running n8n via (Docker, npm, n8n cloud, desktop app): self-hosted n8n (hostinger)
  • Operating system: Ubuntu 24.04

I recommend the following:

  • Gmail Trigger generates an attachment with a binary field > attachment_0
  • No intermediate node deletes binaries
  • Switch doesn’t touch the binary (it only evaluates it)
  • The attachment_0 field is present just before Google Drive - Upload
  • Use Move Binary Data if necessary to ensure it’s safe

Make sure the binaries are forwarded correctly, on the Switch node, make sure you DO NOT modify the data structure and only perform the evaluation you need.

1- On nodes like Set, if you use them after the Switch node, set the “Keep Only Set” option to false so that the binaries are not lost.
2- Verify that the Switch output still contains the binary > attachment_0 field.
3- You can verify this by clicking the “Binary” tab in the Switch node output.

My sub-workflow returns a json. When I remove the sub-workflow node, the upload with attachment_0 works.

Maybe, it doesn’t work because of a input mix, json and binary.

I still don’t have the solution.

Since I am not sure about your sub-workflow purpose.

Here is my solution

Basically because binary can not pass the long path.
You can get the message again with attachment so it will have binary in front of drive node.

My sub-workflow helps to find a Drive folder ID of a given label from Drive parent folder ID. Very useful.

Your solution doesn’t work because sub-workflow is not executed, so after the combine node as well.

Find below my new workflow from your solution :

oh yes because I only provide part of the entire workflow

You can connect the trigger to both path
sub workflow and gmail

The point is you don’t need them in one path.

Separate them into different path and merge them together so you can get the binary data.

Hey @z0om ,

Try using this simple solution.

Just insert this code node before the node where you want to access the binary file.

Hope this helps!

Let me know : )

The only solution whick works until now. It is what I did.
I just hope there is an easier existing solution.

Thanks for helping.