How to Connect Your N8N Workflow to Google Services

How to Connect Your N8N Workflow to Google Services

In the modern automation landscape, connecting your tools is more important than ever. Whether it’s syncing data from a spreadsheet, sending automated emails, or logging events into a calendar, Google’s suite of services helps the core of many workflows. With n8n, a flexible and open-source workflow automation platform, you can build powerful, event-driven automations that plug directly into Google services.

If you’ve deployed n8n using Elestio, your setup is already production-ready with HTTPS, persistent storage, backups, and a public endpoint. That makes integrating with Google’s APIs even easier. In this guide, you’ll learn exactly how to connect your n8n workflow to services like Gmail, Google Sheets, Drive, and Calendar using OAuth2.

Why Use Google Services with n8n?

Google’s APIs provide robust programmatic access to almost every tool in the Google Workspace ecosystem. This allows you to:

  • Automatically read and write to Google Sheets for data processing.
  • Send emails via Gmail without manual effort.
  • Organise and manage Google Calendar events.
  • Handle files in Google Drive for backups, logging, or sharing.

When paired with n8n, these capabilities become building blocks in dynamic, multi-service workflows.

Create a Google Cloud Project

Start by logging into the Google Cloud Console. You’ll need to create a project that represents your n8n application.

From the top menu, click the project selector and choose New Project. Give it a name like n8n Automation, then click Create. This project will host your OAuth credentials and API access.

Creating new project in Google Console

Next, head to the API & Services section and open the Library.

API Library in Google Services

Here, you must enable the APIs relevant to the services you want to use. For example, if you’re planning to work with spreadsheets, enable the Google Sheets API. For email, enable Gmail API. Repeat this process for each service (like Drive or Calendar) that you plan to integrate with.

Google requires every app accessing user data to present a consent screen and authenticate using OAuth 2.0. This process ensures that data access is secure and clearly authorised.

Begin by navigating to the OAuth consent screen in the Cloud Console sidebar. Select the “External” user type (unless you’re part of a Google Workspace organisation) and fill in the necessary fields: application name, support email, and developer contact info. You can skip the logo and branding if you’re just testing.

Once saved, proceed to the Credentials tab and click Create Credentials > OAuth client ID.

Creating Credentials in Google Services

Choose Web Application as the app type. Now it’s time to define redirect URIs.

OAuth settings in Google Services

Since you’re using Elestio, your n8n instance already runs over HTTPS with a public domain. Your redirect URI should follow this pattern:

https://<your-elestio-subdomain>.elestio.app/rest/oauth2-credential/callback

Replace <your-elestio-subdomain> with the actual subdomain assigned to your instance. This URL must match exactly, or Google will block the OAuth callback.

Redirect settings in Google Services

After creating the credentials, Google will display your Client ID and Client Secret. Save these in a secure location, you’ll need them for the next step.

Create Google Credentials in n8n

Now that your Google app is configured, switch to your n8n instance hosted on Elestio. From the sidebar, open the Credentials section and click Create New. Select the Google service you intend to use, for example, Google Sheets, Gmail, or Google Drive.

When the credential editor opens, choose OAuth2 as the authentication method. You’ll be asked to provide:

  • Client ID and Client Secret: These come from your Google Cloud Console.
  • Scope: This defines what data n8n can access. For example:
    • For Gmail: https://www.googleapis.com/auth/gmail.send
    • For Sheets: https://www.googleapis.com/auth/spreadsheets
    • For Drive: https://www.googleapis.com/auth/drive.file
  • The default Auth URL and Token URL fields can remain unchanged:
    • Auth URL: https://accounts.google.com/o/oauth2/auth
    • Token URL: https://oauth2.googleapis.com/token
  • The Redirect URL should already be filled based on your n8n deployment (Elestio auto-configures this correctly).
N8N Auth configuration in N8N

Click the Connect OAuth Account button. You’ll be redirected to a Google login and authorisation screen. After granting access, n8n will store the OAuth tokens securely, and the credential will be marked as connected.

Build a Workflow with Google Services

With credentials in place, you can start building workflows that interact with your Google account. Let’s walk through an example: sending an automated email using Gmail when a new row is added to a Google Sheet.

Begin your workflow by adding a Google Sheets node. Choose “Read Rows” as the operation, connect it to the Google Sheets credential you just created, and select the spreadsheet you want to monitor. You can filter by range, header row, and return only new data.

Next, add a Gmail node. Set the operation to “Send Email” and map the recipient’s email from the sheet (e.g., {{$json["email"]}}). Customise the subject and body with dynamic data from the previous node.

Connect the nodes and test the workflow. If all is set up correctly, each new spreadsheet row will trigger an email, automating a tedious communication task in seconds.

Tips for Production-Ready Integration

To make your Google-n8n integration stable and scalable, keep the following in mind:

  1. Use narrow scopes: Only request the minimum permissions needed to reduce security risks and improve user trust.
  2. Monitor your quotas: Google enforces API usage limits. Check your Cloud Console regularly to avoid hitting these thresholds.
  3. Refresh tokens: n8n handles OAuth token refreshing automatically, but expired credentials can still happen if the Google account revokes access.

Also, take advantage of Elestio’s backup and monitoring features to protect your automation environment.

Final Thoughts

n8n on Elestio provides an excellent foundation for automating Google services without worrying about infrastructure setup. Whether you’re syncing Sheets data to a database, sending smart reminders via Gmail, or managing files in Drive, the combination of Elestio’s managed hosting and n8n’s visual workflow builder makes it all easy to orchestrate. With OAuth2 configured correctly and your workflows in place, you now have a powerful, secure bridge between your Google account and the rest of your tech stack without writing a single line of backend code.

Thanks for reading ❤️

Thank you so much for reading, and do check out the Elestio resources and Official N8N documentation to learn more about N8N. Click the button below to create your service on Elestio. See you in the next one👋