...

How to Set Up Google Credentials in n8n

To connect Google services (such as Google Sheets, Drive, Gmail, and others) to n8n, you need to create and configure an OAuth 2.0 Client ID in Google Cloud Console, then use those credentials in n8n.

Previously on our website, we explained how to install n8n Community Edition on a VPS — if you don’t yet have a working n8n instance, start with that guide.

1. Create an OAuth 2.0 Client ID in Google Cloud Console

  • Go to Google Cloud Console.
  • In the menu, navigate to: APIs & Services → Credentials.

    «Credentials» Google Cloud Console

  • Click Create credentials → OAuth client ID.

    OAuth Client ID

  • In the Application type field, select Web application.

    Web application

  • Enter a name, for example: n8n Google OAuth.
  • In the Authorized redirect URIs section, add the URL that n8n provides when you create a Google OAuth credential.

    Добавление Redirect URI

  • Save and make a note of your Client ID and Client Secret.

2. Enable the Required APIs

  • In Google Cloud Console, open APIs & Services → Library.

    API

  • Find and enable the necessary APIs:
    • Google Sheets API
    • Google Drive API
    • Gmail API

3. Configure the Credentials in n8n

  • Open your n8n instance and go to Credentials.
  • Click Add credential.
  • Select Google OAuth2.

    Google OAuth2

    Google OAuth2

  • Paste your Client ID and Client Secret.
  • Log into your Google account and grant access.

4. Alternative Method: Service Account

If you don’t need a user to sign in to a Google account, you can use a Service Account for server-side scenarios:

  • In Google Cloud Console, create a Service Account.
  • Download the JSON key.
  • In n8n, when creating credentials, choose Google Service Account and upload the JSON file.
Tip: Keep all Client IDs, Client Secrets, and JSON keys stored securely. Never share them publicly or expose them in open repositories.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

    We use a variety of tools, including cookies, to provide the basic services and functionality of our site, and to collect data about how visitors interact with our site, products and services. By clicking "Accept", you agree to the current terms and conditions of use of the site and give permission to use this data. Otherwise, please leave the site.

    Spelling error report

    The following text will be sent to our editors:

    Seraphinite AcceleratorOptimized by Seraphinite Accelerator
    Turns on site high speed to be attractive for people and search engines.