Enable the API
In Google Cloud Console, select the project used for this automation, open APIs & Services → Library, find Google Drive API, and enable it.
Configure OAuth
- Configure the OAuth consent screen and add your Google account as a test user while the app is in testing.
- Create an OAuth client for n8n.
- Copy the exact callback URL shown inside n8n into Google’s allowed redirect URLs.
- Give it only the Drive access the upload needs.
- Save the client ID and client secret in the n8n Google Drive credential, then complete the consent flow.
The callback address must match exactly. Even
httpinstead ofhttps, or one extra slash, can break it.
Verify the upload
Create a temporary Google Drive Upload file step. Upload a tiny test text file to the destination folder, then confirm:
- the expected Google account owns or can access it;
- it lands in the intended folder;
- the n8n node returns a file ID and usable web URL;
- n8n returns the file ID and link you expect.
Keep it safe
- Never commit the client secret or exported n8n credential data.
- Avoid a broad full-Drive scope if an app-file or narrower scope supports the workflow.
- Review test-user and consent-screen status before other team members connect.
Official references: Google OAuth 2.0 for web server applications and choosing Drive API scopes.