Download attachments from gmail trigger

Hi !

Here is a very simple workflow to download attachments form specific emails (matching a label in gmail) and uploading the attachments in Google drive.

Problem is, when I have my binary, it looks like the workflow cannot locate the binary file to upload it to Google Drive.
Indeed I have this error :

“ERROR: File not found: /home/node/.n8n/binaryData/workflows/PUJKnDS4x51rE7FF/executions/19459/binary_data/4754dc33-6da4-4156-b0dc-5814aba46dff”

Moreover, when I try to preview or download manually the binary (pdf) is not available

when I try to preview :

and when i try to download manually it sais that the file is note available.

Thank you for your precious help !

Information on your n8n setup

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

Hi !
Is it possible to see what is possible to do with my issue please.
Thank so much for your help.

Go n8n ! :slight_smile:

Hi @sssamsss8, I am very sorry you’re having trouble with this. I believe you have encountered a bug which is currently under investigation by our engineering team.

Can you try saving the execution data of your workflow like so?

  1. Open your workflow settings:

  2. Make sure to “Save manual executions” to true (and also “Save failed production executions” and “Save successful production executions”):

  3. Click Save

Afterwards, downloading binary data inside n8n should again work as expected. Please do let me know if you’re still having trouble even after changing the setting above and re-running your workflow.

2 Likes

Thank you !!! It is working thanks to that.

1 Like

@MutedJam , I have an additional question regarding my goal to download attachments from Gmail in order to upload them in Airtable.

Do have an advice on how to upload attachments field in Airtable with a binary from Gmail ?

Hi @sssamsss8, this is really tricky I am afraid.

Airtable does not allow direct uploads through their API (or at least they didn’t last time I checked). So you would have to first upload your file to a service providing a public URL for your file, then pass the URL on to Airtable. I’ve described the Airtable part in a bit more detail over here: Insert image to Airtable - #2 by MutedJam

Thank you !
Google Drive can’t allow me to get a public URL for my file ?
I had a look at the attached link but I stil don’t see how to get such a URL. Any clue ?

Hi @sssamsss8, you’re right afaik Google Drive does indeed not provide public permalinks pointing directly to a file rather than their UI. The thread I’ve linked just describes the Airtable limitation, it does not discuss the options to create a public URL for a file.

There is, however, a number of options when using n8n. Think S3, a simple web hoster offering (S)FTP upload for their webspace, or even designated file sharing services providing an API.

The question is whether that’s worth the hassle. Perhaps instead you simply want to upload your files to Google Drive, update sharing permissions, then simply store the link in Airtable instead of the actual file?

2 Likes

Indeed, I created Google Drive docs and updated the permissions. It works just fine this way.

Once again it was very usefull to have your help here ! Thank you very much.

1 Like

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