Skip to Content

Google Workspace with OpenClaw

How to Integrate Google Workspace with OpenClaw
December 2, 2026 by
Google Workspace with OpenClaw
Lingkail Sdn Bhd, cheahwei.leow@lingkail.com

Introduction

The Google Workspace integration allows OpenClaw to interact with Google Services such as Gmail, Google Calendar, Google Drive, Google Docs, Google Sheets, and Google Slides. This enables the OpenClaw agent to retrieve information from Google Workspace and perform supported actions such reading emails, accessing documents, retrieving spreadsheet data, and appending new records to Google Sheets.

For this setup, OpenClaw was already installed and configured before starting the Google Workspace integration.

1. Install the Google OAuth Plugin

Install the Google OAuth plugin to provide authentication support between OpenClaw and Google Workspace services.

Run:
openclaw plugins install clawhub:@jason-vaughan/openclaw-google-oauth

The plugin was installed under the ID:
tangleclaw-google-oauth

2. Enable the Google OAuth Plugin

Enable the installed Google OAuth plugin so that OpenClaw can use it for Google account authentication.

Run:
openclaw plugins enable tangleclaw-google-oauth


This step is important because the Google Workspace skill depends on this plugin.

Check that the plugin is installed:
openclaw plugins inspect tangleclaw-google-oauth

You can also run:
openclaw plugins doctor

This checks plugin discovery, loading, compatibility, and configuration.

3. Create a Google Cloud Project

Open the Google Cloud Console in your browser.

Create a new project for the OpenClaw integration. For example:
OpenClaw Google Workspace

Use this project only for the Google Workspace Integration so that the OAuth configuration is easier to manage.

4. Enable the Required Google APIs

Inside the Google Cloud project, go to:
APIs & Services -> Library

Enable the APIs required for the Google Workspace applications you want OpenClaw to access:

  • Gmail API
  • Google Calendar API
  • Google Drive API
  • Google Docs API
  • Google Sheets API
  • Google Slides API

You do not necessarily need to use every service immediately, but enabling them prepares the project for the Workspace tools.

5. Configure Google OAuth

Open:
Google Auth Platform
Configure the OAuth application.

For the audience, select:
External

During development/testing, keep the application in:
Testing

6. Add Your Google Account as a Test User

This step is important while the OAuth application ID in Testing mode.

Under the OAuth application's Audience/Test users section, add the Google account that OpenClaw will access.

For example:
your-google-account@gmail.com

If this account is not registered as a test user, Google may show an error similar to:

7. Create an OAuth Client

Go to:
Google Auth Platform -> Clients
Create a new OAuth client.

Select:
Application type: Desktop app

Give it a suitable name, for example:
OpenClaw Desktop Client

Download the OAuth client credentials JSON file.

8. Store the OAuth Credentials

Create the OpenClaw secrets directory if necessary:
mkdir -p~/.openclaw/secrets/gmail-credentials.json

Then restrict access to the file:
chmod 600 ~/.openclaw/secrets/gmail-credentials.json

Check the permissions without displaying the secret content:
ls -l ~/.openclaw/secrets/gmail-credentials.json

The permissions should look similar to:
-rw--------


9. Enable the Google Workspace skills for the Agent

For the main agent, enable the Google Workspace skill:
openclaw config set agents.entries.main.skills '["google-workspace"]'

Check it:
openclaw skills info google-workspace --agent main

A successful configuration should show that the skill is ready and visible to the model.

For example:
google-workspace ✓ Ready

Visible to model: yes
Available ass command: yes

10. Allow the OAuth Tools

If the agent uses a restricted/minimal tool profile, the Google OAuth tools must also be exposed to the agent.

Start with:
openclaw config set agents.entries.main.tools.alsoAllow '["exec", "google_auth_start", "google_auth_complete"]'

Check the configuration:
openclaw config get agents.entries.main.tools.alsoAllow

You should see:
exec
google_auth_start
google_auth_complete

If your agent does not need exec, preserve whatever tools were already configured instead of blindly replacing them. The important part is not to accidentally remove existing required tools.

11. Start Google OAuth Authorization

Open the OpenClaw Dashboard and ask the main agent to start Google authorization.

For example:
Start Google OAuth authorization.

OpenClaw should invoke:
google_authStart

It will provide a Google authorization URL.

Open that URL in your browser.

12. Sign In to Google

Sign in using the Google account that you previously added as a Test User.

Google will display the permissions requested by the integration.

Review them carefully before approving access.

Because the integration can request broad Google Workspace permissions, using a dedicated testing/work account is preferable to connecting an important personal account during development.

13. Complete the OAuth Redirect

After authorization, the browser may redirect to a localhost URL similar to:
http://localhost/?code=AUTHORIZATION_CODE&scope=...

The localhost page itself may not load. That is okay.

The important part is the value after:
code=

and before:
&scope=

For example, conceptually:
http://localhost/?code=
ABC123&scope=...

Use only the authorization code, not the entire localhost URL.

Enter that code directly into OpenClaw when completing the OAuth process.

Do not share the authorization code in chat, screenshots, documentation, or public repositories.

The corresponding tool is:
google_auth_complete

Oauth authorization codes are temporary and normally single-use. If the exchange fails because the code has expired or has already been used, start a new authorization flow instead of repeatedly reusing the same code.

14. Confirm OAuth Completion

After successful authorization, OpenClaw stores the token locally.

In our setup, the token file was:
~/.openclaw/secrets/gmail-token.json

Do not display this file with cat or share its content.

You can safely check that it exists:

ls -l ~/.openclaw/secrets/gmail-token.json

At this point, authentication is complete.

15. Enable Google Workspace Read Tools

It is safer to begin with read-only operations before enabling tools that can send emails, edit files, or delete information.

For the setup we tested, use:
openclaw config set

agents.entries.main.tools.alsoAllow '["exec","google_auth_start","google_auth_complete","drive_files_list","drive_file_get","gmail_messages_list","gmail_message_get","calendar_events_list","calendar_event_get","docs_get","sheets_get","sheets_values_get","slides_get"]'

Check the resulting allowlist:
openclaw config set agents.entries.main.tools

This gives the agent access to read operations while leaving destructive/write operations disabled.

16. Test Google Drive

In the OpenClaw Dashboard, use a natural-language request such as:
List the files in my Google Drive.

OpenClaw should use:
drive_files_list

If files from the connected Google Drive are returned, the Drive connection is working.

You can also ask it you retrieve information about a particular file using:
drive_file_get

17. Test Gmail

Try:
Show my 3 most recent Gmail messages with sender, subject, and date. Retrieve only the necessary email headers. Do not retrieve full email bodies.

OpenClaw should use:
gmail_messages_list

To read a specific message, it can subsequently use:
gmail_message_get

For example:
Read the email with the subject "Office Maintenance Request".

At this stage, OpenClaw can read messages but cannot send or delete them because those tools have not been allowed.

18. Test Google Calendar

Try:
List my upcoming Google Calendar events.

OpenClaw should use:
calendar_events_list

To retrieve more information about one event, it can use:
calendar_event_get

19. Test Google Docs

Make sure the Drive contains at least one native Google Docs document.

Then ask:
Find a Google Docs file in my Google Drive and read its content.

The normal flow is:
Google Drive -> Find document -> Get document ID -> docs_get -> Return document content


If OpenClaw successfully returns content from the document, Google Docs read access is working.

20. Test Google Sheets

For the cleanest test, use a native Google Sheet rather than only an uploaded .xlsx file.

If an Excel file has been updated to Drive, open it with Google Sheets and use:
File -> Save as Google Sheets

Then ask OpenClaw:
Find the Google Sheet named Office_Expenses_Test and read its data.

If OpenClaw asks for a range, you can specify one such as:
A1:F20
or, using the worksheet/tab name:
Office Expenses!A1:F20

OpenClaw can then use:
sheets_get
sheets_values_get



A successful result should return the actual values stored in the spreadsheet.

21. Increase the Agent Timeout for Google Workspace Workflows


During testing, we found that a local model could spend a long time generating a tool call. A 120-second timeout could expire even though the Google operation itself was successful.


Set the timeout to 180 seconds:
openclaw config set agents.defaults.timeoutSeconds 180



Verify:
openclaw config get agents.defaults.timeoutSeconds



Expected:
180

22. Write/Delete Tools to Enable Only When Needed

The plugin also provides tools capable of changing Google Workspace data, including operations such as:
calendar_event_create
calendar_event_delete
docs_append_text
docs_create
drive_file_trash
drive_permission_create
gmail_message_modify
gmail_message_send
gmail_message_trash
sheets_create
slides_create
Do not enable all of these simply because they are available.


A better progression is:

Read access → test → limited write access → test → enable additional actions only when the workflow actually requires them.

For example, a Gmail-to-Sheets workflow only needs Gmail read tools and sheets_values_append; it does not need permission to delete Drive files or send emails.

OpenClaw Setup
How to Set Up OpenClaw on Mac mini