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
| Scope | What it allows | Google level |
|---|---|---|
openid, email | Show which account is connected | Non-sensitive |
https://www.googleapis.com/auth/gmail.send | Send emails (no reading of the mailbox) | Sensitive |
https://www.googleapis.com/auth/calendar.events | Read, create, update and delete events | Sensitive |
https://www.googleapis.com/auth/calendar.calendarlist.readonly | List the account's calendars (calendar dropdown of a step) | Sensitive |
https://www.googleapis.com/auth/spreadsheets | Read and write Google Sheets | Sensitive |
https://www.googleapis.com/auth/drive.file | Create files; only files created by Runbase or picked in Drive are visible | Non-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
- Open the Google Cloud console and create a project (for example "Runbase").
- In APIs & Services › Library, enable Gmail API, Google Calendar API, Google Sheets API, Google Drive API and Google Picker API.
2. Configure the consent screen
In Google Auth Platform (or APIs & Services › OAuth consent screen):
- Branding: app name, support email, logo, and links to your home page, privacy policy and terms of service, all on a domain you own.
- Audience: External. While the app is in Testing, add the emails of the people who will connect an account as test users.
- Data access: add exactly the scopes of the table above.
3. Create the OAuth client
- In Clients, create a client of type Web application.
- Under Authorized redirect URIs, add
<BETTER_AUTH_URL>/api/connections/callback, for examplehttps://runbase.example.com/api/connections/callback(http://localhost:7100/api/connections/callbackin 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 foropenid,emailandprofile). - 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:
- In APIs & Services › Library, enable Google Picker API.
- 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.
- Application restrictions: Websites, with your app's address, for
example
- 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.filescope). - Add both to
.envand restartweb:
GOOGLE_PICKER_API_KEY=AIza...
GOOGLE_PICKER_APP_ID=123456789012The 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
- Add a Google step, for example Google Calendar: list events.
- 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.
- 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
connectioninput, also listed by theconnections.listMCP tool).
Disconnecting an account (Settings › Connections) revokes Runbase's access at Google; the steps that used it fail until it is connected again.