Google Workspace integration

Connect Google Workspace so your Agents and Flows can use Gmail, Docs, and Sheets through tools. Google Workspace also offers Calendar and Drive permission bundles. It is not a standalone Flow step. Add its tools to an Agent or a prompt step in a Flow.

Before you begin

Prepare the following items before you connect Google Workspace:

  • A Google Cloud project that you can configure.
  • The Google APIs for the services that you plan to use.
  • An OAuth 2.0 client ID and client secret for a Web application.

Create an OAuth client

Use your own Google Cloud OAuth client to connect Google Workspace. Follow these steps:

  1. In the Google Cloud Console, create or select a project.
  2. Enable the Google APIs that match the services that you plan to use. For example, enable Gmail API, Google Calendar API, Google Docs API, and Google Sheets API. Match each API to its corresponding service.
  3. Configure the OAuth consent screen. For a Google Workspace organization, select Internal. For other accounts, select External and add your account under Test users.
  4. Create an OAuth 2.0 client of type Web application.
  5. Add the Runtype redirect URI to Authorized redirect URIs. Use https://api.runtype.com/v1/oauth/google/callback in production. The connection form displays the exact URI for your environment.
  6. Save the client ID and client secret.

External apps in Testing mode receive refresh tokens that expire after 7 days. Publish the app, or use an Internal app in a Google Workspace organization, to avoid this testing limit.

Connect Google Workspace

To connect Google Workspace after you create the client, follow these steps:

  1. In Runtype, open Settings > Integrations.
  2. On Integrations, find Google Workspace and click Connect.
  3. In the connection form, select at least one service: Gmail, Calendar, Docs, Sheets, or Drive. Runtype requests only the scopes for the services that you select.
  4. In Client ID, enter your Google Cloud OAuth client ID.
  5. In Client secret, enter your Google Cloud OAuth client secret.
  6. Click Connect Google.
  7. In the Google consent popup, approve the requested scopes. After approval, Runtype shows your connected Google account in Settings > Integrations.

Runtype exchanges the authorization code and stores the tokens server-side. The tokens do not pass through your browser.

Automatic refresh and reconnection

Runtype refreshes the access token before it expires. Google can revoke a refresh token if you remove Runtype from your Google Account or if the refresh token expires.

If the connection shows Needs reconnection, follow these steps:

  1. In Runtype, open Settings > Integrations.
  2. On the connection marked Needs reconnection, click Reconnect.
  3. In the Google consent popup, approve the requested scopes.

Available tools

After you connect, the following tools are available to Agents and prompt steps in Flows:

Gmail

Use these Gmail tools:

  • gmail_send: send an email.
  • gmail_search: search for emails with Gmail search operators.
  • gmail_read: read a specific email by ID.
  • gmail_create_draft: create an email draft.

Google Docs

Use these Google Docs tools:

  • docs_create: create a Google Doc.
  • docs_read: read content from a Google Doc.
  • docs_append: append content to a Google Doc.

Google Sheets

Use these Google Sheets tools:

  • sheets_read: read data from a Google Sheet using A1 notation ranges.
  • sheets_write: write data to a Google Sheet.
  • sheets_create: create a Google Sheet.

Add the tools that you need when you configure an Agent or a prompt step.

Permissions and scopes

Select only the services that your Agent or Flow needs. Runtype requests only the scopes for the services that you select. The following permissions describe each service:

  • Gmail: send, search, and read email, and create drafts.
  • Calendar: read and manage calendar events.
  • Docs: create, read, and append to documents.
  • Sheets: read, write, and create spreadsheets.
  • Drive: access files that the integration creates.

Google Workspace uses OAuth 2.0. Runtype does not store your Google password.

Revoke Google access

To revoke Google Workspace access, remove Runtype from your Google Account:

  1. Open Google Account permissions.
  2. Find Runtype in the list of Third-party apps.
  3. Click Remove access.

Next steps