"Upload File" Google Drive node with Service Account not working

Describe the problem/error/question

REALLY need help here!!!
I’m not managing to use “Upload File” Google Drive node with Service Account.
Basically:
“Create Folder” works with Service Account.
“Upload File” works with OAuth.
“Upload File” does NOT work with Service Account.
I’ve tried to repeat the process with another n8n Workflow, another n8n Account, with another Google Service Account, with another Google Workspace. Always the same problem.

What is the error message (if any)?

Problem in node ‘Google Drive1‘
Request failed with status code 403

Please share your workflow

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

Share the output returned by the last node

Problem in node ‘Google Drive1‘
Request failed with status code 403

Information on your n8n setup

Debug info

core

  • n8nVersion: 1.86.1
  • platform: docker (cloud)
  • nodeJsVersion: 20.19.0
  • database: sqlite
  • executionMode: regular
  • concurrency: 5
  • license: community

storage

  • success: all
  • error: all
  • progress: false
  • manual: true
  • binaryMode: filesystem

pruning

  • enabled: true
  • maxAge: 168 hours
  • maxCount: 2500 executions

3 Likes

Error 403 suggests a permissions issue.

Does that service account have the right permission to upload a file to the folder (I am not too familiar with Google Drive permissions, but I suspect shared drives could impact the situation; is this a shared drive?)

Have you also enabled Google Drive API while creating the service account, as documented here?

I am facing the same issue since yesterday. Everything is working except the uploading. As i see this post here, it might be an issue in some javascript libary i guess? Its very frustrating as the workflow has stopt after several successful month.

Here is the whole stacktrace. I am using the same n8n version (1.89.2)

{
  "errorMessage": "Request failed with status code 403",
  "errorDetails": {},
  "n8nDetails": {
    "n8nVersion": "1.89.2 (Cloud)",
    "binaryDataMode": "filesystem",
    "stackTrace": [
      "AxiosError: Request failed with status code 403",
      "    at settle (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/core/settle.js:19:12)",
      "    at IncomingMessage.handleStreamEnd (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/adapters/http.js:599:11)",
      "    at IncomingMessage.emit (node:events:536:35)",
      "    at endReadableNT (node:internal/streams/readable:1698:12)",
      "    at processTicksAndRejections (node:internal/process/task_queues:82:21)",
      "    at Axios.request (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/core/Axios.js:45:41)",
      "    at processTicksAndRejections (node:internal/process/task_queues:95:5)",
      "    at invokeAxios (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/execution-engine/node-execution-context/utils/request-helper-functions.js:173:16)",
      "    at Object.httpRequest (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/execution-engine/node-execution-context/utils/request-helper-functions.js:669:20)",
      "    at /usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Google/Drive/v2/actions/file/upload.operation.js:133:27",
      "    at processInChunks (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Google/Drive/v2/helpers/utils.js:141:5)",
      "    at ExecuteContext.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Google/Drive/v2/actions/file/upload.operation.js:131:5)",
      "    at ExecuteContext.router (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Google/Drive/v2/actions/router.js:55:30)",
      "    at ExecuteContext.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Google/Drive/v2/GoogleDriveV2.node.js:36:12)",
      "    at WorkflowExecute.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/execution-engine/workflow-execute.js:681:27)"
    ]
  }
}

AFAIK, service account cannot be used for Google Drive since they not having the scope for managing Google Drive.
You must use your Oauth2 instead.

Hm but it worked before, over several month :confused:

I have the same problem, for weeks it worked and now with Service Account it gives this problem, we tested it with a “virgin” account and it gave the same result, Service Account is better because it doesn’t log out after a few days like OAuth.

I also have the same problem. When trying to upload a file with the Google Drive node it is not working having the Google Service Account as Credentials. However, copying a file in the same directory with the same Google Service Account is working. I am using n8n version 1.102.0.

1 Like

Same issue. Spent 2 hours trying to figure out if my authorization settings are wrong.
Eventually I just created empty file, which I update and rename to get the same effect.

Still it would be really good to have basic functionality to be fixed :frowning:

We have a workflow that’s been working just fine for 4 weeks with google upload using a service account, upgraded to “latest stable” version of n8n and it broke that workflow with 403. We debugged everything on the google side, yes we have google drive API enabled, and it was clearly and n8n upgrade. The work around we got was to change to a user with OAuth2, write files to the root drive of that user and then copy to the destination location. Ultimately adding extra steps and not allowing us to use service accounts which have one type of job in the world - this job.

Alright after losing all of my hair I managed to “fix” this. OAuth2 was a big nono for my use case, so after a lot of trial and error this is what I got:

  • Something is definetly wrong with the Google Drive Upload File node using a Service Account
  • I had to create the file using a HTTP Request node in a very specific way to avoid the 403 error, but couldn’t pass the binary file to it for whatever reason that i do not comprehend.
  • My solution was to create a blank pdf file, and after that I was able to use the Google Drive File Update node, passing the binary file with the option Change File Content toggled, no 403 errors.

Basically: create the file with the HTTP Request node, content doesn’t matter, and update it afterwards with the actual binary

PS

  • The file needs to be created in a shared drive which the service account has access to (Contributer or higher)
  • You’ll need to add the scope “https://www.googleapis.com/auth/drive” in your Service Account credential, otherwise the http request node won’t work

I am experiencing the same issue—workflows that previously worked are now returning 403 errors and I am unable to use them at the moment. I have verified that the service account itself can upload files without any problems when tested locally.

Same issue here!

1 Like

Hey folks, I’ve just tried it with [email protected] and it was working for me with a service account.

  • To upload to my drive I had to invite the service account user (email) as editor to a folder.
  • For shared drives I had to invite the service account user (email) as editor to the drive.

Me again, so I digged deeper into the service account 403 issue when trying to upload.

Turns out google service accounts created after 15th April 2025 have 0 storage quota for drive, making them unusable to access my drive. Service accounts should only access shared drives.

A workaround exists where a service account can impersonate a real user, but it requires Domain-wide Delegation activated in your cloud console which should be used with caution.

Granting this service account access to your organization’s data via domain-wide delegation should be used with caution. It can be reversed by disabling or deleting the service account or by removing access through the Google Workspace admin console.

My old service account has a storage quota:

You can test it yourself using an HTTP Request node using your service account credential (with http node usage option enabled). For scopes in the service account credential you can use: https://www.googleapis.com/auth/drive, https://www.googleapis.com/auth/drive.appdata, https://www.googleapis.com/auth/drive.photos.readonly

Hello @marcus, thanks for your reply.
I tried creating the file in a shared drive and the error obtained is 403 (image 1).
I’m using a SA with maximum privileges on the Shared Drive (Administrator).
Now, when I create the file from text (image 2), there the error tells me it is related to StorageQuota. Based on the error messages given as output, they seem to be 2 different types of errors. The strange thing in case 2 is that the SA cannot create the file (even though it’s a Shared Drive and the SA has maximum privileges on said Shared Drive).

Thanks!

Image 1

image

Image 2

2 Likes

Hey @tincho,

I dug a bit deeper and can confirm that the way we upload files to google shared drive is incompatible with the permission change to service accounts since April 2025. So uploading via service accounts seems broken.

I am currently working on a draft fix to send to our node engineering team and will update this thread accordingly. Sorry for all the trouble but the permission change from google went under our radar.

2 Likes

Hi @marcus, not the news we were expecting but great news though. Thanks for your support on this.
Keep us posted, please. And, thanks for your time and support on this.

Is it safe to say that the best way around this is to use OAth in the meanwhile? I think there are our workarounds in the thread, but I think migrating temporaly to OAuth is straightforward.

Quick update, I created a PR that fixes the issue to upload files to google shared drives with service accounts created after April 2025. I handed the PR over to our node engineering team for review and testing. I hope we can release it soon.

5 Likes

The PR to fix Google Service accounts uploading to shared drives was merged into master and should be released soon.

1 Like

Great!!! :rocket: Thank you very much! It’s not v109, right?