I’m new here and also as an n8n user. Congratulations to the team for what they’ve built so far.
I want to send a document that is on Google Drive as a pdf using Gmail, I tried to use Drive’s download node, but I wasn’t successful. I’m using n8n with the npx command.
Displays ERROR: Forbidden - perhaps check your credentials?
Request failed with status code 403
{"message":"Request failed with status code 403","name":"Error","stack":"Error: Request failed with status code 403\n at createError (C:\\Users\\Samsung\\AppData\\Roaming\\npm\\node_modules\\n8n\\node_modules\\axios\\lib\\core\\createError.js:16:15)\n at settle (C:\\Users\\Samsung\\AppData\\Roaming\\npm\\node_modules\\n8n\\node_modules\\axios\\lib\\core\\settle.js:17:12)\n at IncomingMessage.handleStreamEnd (C:\\Users\\Samsung\\AppData\\Roaming\\npm\\node_modules\\n8n\\node_modules\\axios\\lib\\adapters\\http.js:269:11)\n at IncomingMessage.emit (node:events:402:35)\n at endReadableNT (node:internal/streams/readable:1343:12)\n at processTicksAndRejections (node:internal/process/task_queues:83:21)"}
Hi @Claudio_Balbino, welcome to the community and thanks so much for reaching out!
A 403 status would indicate a permissions problem as per Google’s docs, which includes rate limiting problems. Is your initial Google Sheets node returning multiple items and do individual operations work using your Google Drive credentials (e.g. if you run a simple workflow consisting of one node downloading one file, would this work for you)?
If so, you might have hit this Google Drive API write limit:
The rate of Drive API write requests is limited—avoid exceeding 3 requests per second of sustained write or insert requests, per account. Note: This rate limit can’t be increased.
I’m not sure I understand correctly, but in this example my spreadsheet has only one line… to test I eliminated some node from the drive and the problem persists
{"message":"Request failed with status code 403","name":"Error","stack":"Error: Request failed with status code 403\n at createError (C:\\Users\\Samsung\\AppData\\Roaming\\npm\\node_modules\\n8n\\node_modules\\axios\\lib\\core\\createError.js:16:15)\n at settle (C:\\Users\\Samsung\\AppData\\Roaming\\npm\\node_modules\\n8n\\node_modules\\axios\\lib\\core\\settle.js:17:12)\n at IncomingMessage.handleStreamEnd (C:\\Users\\Samsung\\AppData\\Roaming\\npm\\node_modules\\n8n\\node_modules\\axios\\lib\\adapters\\http.js:269:11)\n at IncomingMessage.emit (node:events:402:35)\n at endReadableNT (node:internal/streams/readable:1343:12)\n at processTicksAndRejections (node:internal/process/task_queues:83:21)"}
Do you have access to the drive/folder, you are trying to upload data to?
I would isolate the drive node and upload a file to a folder before adding it to any workflow. That way, you discard any issues related to permissions/credentials.
I quickly tried this on my end using npx and could indeed reproduce the problem when trying to download a Google Docs file. Even with a simple workflow like this:
Could this be because Google does not allow downloading Google Docs files directly (only in converted formats like MS Word) @RicardoE105? As per this doc:
Note: The only way to download a Google Workspace file is to export and download the file in a different file format.
As @MutedJam explained, looks like for Google native files you need to export to a different mime-type in order to ‘download’ the file.
Right now, Google drive api does not support content downloading for native google drive files (google docs, sheets etc.), so you cant download content (current or of an old revision), you can only export it to a different mime type.
We need to add the export functionality to the node.
I am afraid that’s an operation not currently supported by the Google Drive node.
In case it doesn’t have to be the specific Google Docs file you want to create the PDF file from, you could alternatively use a specialized service to create PDFs. For example Anvil (which you could connect to using our HTTP Request node) or APITemplate.io (which has its own node).
These services essentially create PDF documents for you based on the payload they receive.
Glad to hear this approach is working out for you for now!
I have also tested the enhanced Google Drive node developed by @RicardoE105 already and it’s working great with Google Docs files (including exporting them as PDF). So not much longer before your original approach would work too
@MutedJam and @RicardoE105, Hey! Now I’m looking for a solution to download Google Documents in pdf format. Tell me, is this already deployed in the latest version? I have upgraded to version 0.147.1 and am getting the following error:
@RicardoE105 , Hey!
Is there a timeline for the implementation of this functionality? This can be very important for my project). Thanks in advance for your feedback!