Skip to Content
Runbase

Connect Google (Gmail, Calendar, Sheets, Drive)

Create the Google OAuth client and choose the scopes that let workflows send emails, manage events and edit sheets.

Once Google is set up, anyone in the workspace can connect their Google account from a workflow step (the Account field) or from Settings › Connections. Workflows can then send emails from that Gmail account, manage its calendar events, read and write its sheets, and create files in its Drive.

On Runbase Cloud this is already done: skip to Use it in a workflow. When you self-host, you create your own Google OAuth client once, as below.

What Runbase asks Google for

ScopeWhat it allowsGoogle level
openid, emailShow which account is connectedNon-sensitive
https://www.googleapis.com/auth/gmail.sendSend emails (no reading of the mailbox)Sensitive
https://www.googleapis.com/auth/calendar.eventsRead, create, update and delete eventsSensitive
https://www.googleapis.com/auth/calendar.calendarlist.readonlyList the account's calendars (calendar dropdown of a step)Sensitive
https://www.googleapis.com/auth/spreadsheetsRead and write Google SheetsSensitive
https://www.googleapis.com/auth/drive.fileCreate files; only files created by Runbase or picked in Drive are visibleNon-sensitive

None of these is a restricted scope, so no paid security assessment (CASA) is needed. Do not add gmail.readonly, gmail.modify, https://mail.google.com/ or drive: they are restricted and require that assessment.

1. Create the Google Cloud project

  1. Open the Google Cloud console and create a project (for example "Runbase").
  2. In APIs & Services › Library, enable Gmail API, Google Calendar API, Google Sheets API, Google Drive API and Google Picker API.

In Google Auth Platform (or APIs & Services › OAuth consent screen):

  1. Branding: app name, support email, logo, and links to your home page, privacy policy and terms of service, all on a domain you own.
  2. Audience: External. While the app is in Testing, add the emails of the people who will connect an account as test users.
  3. Data access: add exactly the scopes of the table above.

3. Create the OAuth client

  1. In Clients, create a client of type Web application.
  2. Under Authorized redirect URIs, add <BETTER_AUTH_URL>/api/connections/callback, for example https://runbase.example.com/api/connections/callback (http://localhost:7100/api/connections/callback in development). For Sign in with Google on the login page, also add <BETTER_AUTH_URL>/api/auth/callback/google (same client; sign-in only asks for openid, email and profile).
  3. Copy the client ID and the client secret.

4. Configure Runbase

Add both values to .env, then restart web and worker (docker compose -f docker-compose.selfhost.yml up -d):

OAUTH_GOOGLE_CLIENT_ID=1234-abc.apps.googleusercontent.com
OAUTH_GOOGLE_CLIENT_SECRET=GOCSPX-...

The web container runs the Google sign-in; the worker refreshes access when workflows run, so both need the values. Without them, Google shows as "Not configured" in Settings › Connections.

5. Choose spreadsheets in Drive (Google Picker)

Google Sheets steps have a Choose in Drive button: it opens Google's own file picker, so nobody has to copy a spreadsheet id. It needs two more values:

  1. In APIs & Services › Library, enable Google Picker API.
  2. In APIs & Services › Credentials, create an API key. Restrict it:
    • Application restrictions: Websites, with your app's address, for example https://runbase.example.com/* (http://localhost:7100/* in development).
    • API restrictions: Google Picker API only.
  3. Find the project number on the project's Dashboard (or IAM & Admin › Settings): digits only, not the project id. It is also the start of your OAuth client ID, before the first -. Google uses it to grant Runbase access to the picked file (drive.file scope).
  4. Add both to .env and restart web:
GOOGLE_PICKER_API_KEY=AIza...
GOOGLE_PICKER_APP_ID=123456789012

The API key is public by design (the browser sends it), which is why it is restricted to the Picker API and to your domain. Without these values, Sheets steps ask for the spreadsheet id instead.

6. Testing, then production

  • Testing (default): works right away, only for the test users you listed, and Google asks them to reconnect every 7 days.
  • In production, not verified: anyone can connect, up to 100 users, behind a "Google hasn't verified this app" warning (Advanced › Continue).
  • Verified: no warning, no user cap. Click Publish app, then submit for verification. Google asks for a justification per sensitive scope and a demo video (unlisted YouTube link) showing the consent screen and each scope in use in your app. Expect a few weeks of back and forth. No code change is needed once approved.

Use it in a workflow

  1. Add a Google step, for example Google Calendar: list events.
  2. In Account, pick a connected account or choose Connect a Google account: Google opens in a popup, you approve, the account is selected. Then pick the Calendar from the account's list (the main calendar by default). In a Google Sheets step, Choose in Drive picks the spreadsheet, then the Tab and, to add rows, a value for each column of the first row.
  3. Each account is named after its email. With a single Google account in the workspace, steps use it by default; with several, each step names the one to use (the connection input, also listed by the connections.list MCP tool).

Disconnecting an account (Settings › Connections) revokes Runbase's access at Google; the steps that used it fail until it is connected again.

On this page