omadiaomadia.ai
registry
integrationgoogleworkspace

Google Workspace

@omadia/integration-google-workspace

Connects omadia to your company's Google Workspace: the assistant reads calendars, mail, files and the directory — and, if you allow it, creates events and sends mail. Runs on a technical service account your IT sets up once; no personal login involved.

latest
v0.4.1
license
MIT
versions
7
author
byte5 GmbH

install

In your omadia instance, open Admin → Registries and add this registry, then install Google Workspace from Admin → Plugins → Store.

registryhttps://hub.omadia.ai

setup guide

Connect Google Workspace

This integration talks to the Google Workspace APIs (Calendar, Gmail, Drive/Docs/Sheets, Admin Directory, People) using a Google Cloud service account with domain-wide delegation — server-to-server, no interactive sign-in. Every request impersonates a Workspace user. About 15 minutes, and you need a Workspace super-admin to authorise the delegation.

1. Create a service account + key (Google Cloud Console)

  1. console.cloud.google.com → pick or create a project → APIs & Services → Enable APIs & Services and enable: Google Calendar API, Gmail API, Google Drive API, Google Docs API, Google Sheets API, Admin SDK API, People API (enable only the ones you'll use).
  2. IAM & Admin → Service Accounts → Create service account. Name it (e.g. "omadia") → Done.
  3. Open the service account → Keys → Add key → Create new key → JSON. A .json file downloads. From it you need two values: client_email → field Service-account email, and private_key (the long -----BEGIN PRIVATE KEY----- … block) → field Service-account private key.
  4. On the service account's Details page note the Unique ID (a long number) — that is the Client ID used in step 2.

2. Authorise domain-wide delegation (Workspace Admin console)

  1. admin.google.comSecurity → Access and data control → API controls → Domain-wide delegation → Manage domain-wide delegation → Add new.
  2. Client ID = the service account's Unique ID (step 1.4).
  3. OAuth scopes = the comma-separated scope list. After install, the plugin logs the exact scopes it will request (delegated scopes (authorise these…)); paste those. The defaults are:
    https://www.googleapis.com/auth/calendar.readonly,
    https://www.googleapis.com/auth/gmail.readonly,
    https://www.googleapis.com/auth/drive.readonly,
    https://www.googleapis.com/auth/documents.readonly,
    https://www.googleapis.com/auth/spreadsheets.readonly,
    https://www.googleapis.com/auth/admin.directory.user.readonly,
    https://www.googleapis.com/auth/contacts.readonly,
    https://www.googleapis.com/auth/directory.readonly
    
    With Enable writes on, the requested set changes: add https://www.googleapis.com/auth/calendar.events, https://www.googleapis.com/auth/gmail.send, https://www.googleapis.com/auth/gmail.compose, and the FULL https://www.googleapis.com/auth/drive, https://www.googleapis.com/auth/documents and https://www.googleapis.com/auth/spreadsheets. The full Drive, Docs and Sheets scopes REPLACE their .readonly variants above (do not list both: domain-wide delegation matches scopes literally, so an un-authorised .readonly left in the request fails the whole token). The plugin logs the exact set at activation; authorise that verbatim.
  4. Authorise. Delegation can take a few minutes to propagate.

3. Fill in the fields below

FieldValue
Service-account emailclient_email from the JSON key
Service-account private keyprivate_key from the JSON key (paste the whole PEM block)
Default userThe Workspace user the integration acts as by default (e.g. an assistant mailbox)
Admin userA super-admin's email — used for directory lookups (optional; falls back to the default user)
SurfacesWhich areas to enable (optional; default all)
Enable writesOff = read-only; on = also calendar/gmail writes

Install — connectivity is verified in the background by minting a token for the default user (watch the plugin logs for connected or a token probe failed warning).

Troubleshooting

  • unauthorized_client / 401 at the token step — the Client ID or a scope is not authorised in step 2 (every scope the plugin requests must be listed verbatim), or delegation has not propagated yet.
  • 403 on a surface — that API is not enabled in the Cloud project (step 1.1), or the impersonated user lacks access.
  • invalid_grant — the Default user / Admin user email does not exist in the Workspace domain, or the private key is malformed (paste the entire PEM, including the BEGIN/END lines).
  • Directory returns 403 — directory reads impersonate the Admin user; it must be a real admin and admin.directory.user.readonly must be authorised.

Least privilege: enable only the surfaces you need and leave Enable writes off unless the assistant should create events or send mail.

versions

v0.4.1
>=1.0 <2.048.5 KB2026-08-20
.zipc29c667473a1
v0.4.0
>=1.0 <2.048.1 KB2026-08-20
.zipe96e61c0bde9
v0.3.1
>=1.0 <2.046.6 KB2026-08-03
.zipc600d4d7e2f4
v0.3.0
>=1.0 <2.045.9 KB2026-06-25
.zip80e1c0c79fc6
v0.2.1
>=1.0 <2.042.7 KB2026-06-25
.zip29e961817cdb
v0.2.0
>=1.0 <2.042.3 KB2026-06-25
.zip144769f4195f
v0.1.0
>=1.0 <2.039.6 KB2026-06-16
.zipd177cb4a0416

setup fields

Values the operator fills in at install-time.

gw_sa_key_filejson_file
Service-account key file (JSON)Upload the JSON key file downloaded from the Google Cloud Console (service account → keys → add key). The service-account email and private key below are filled from it automatically — no copying needed. The file itself is not stored.
optional
gw_sa_client_emailstring
Service-account emailThe service account's email (client_email in the JSON key), e.g. omadia@my-project.iam.gserviceaccount.com. This is NOT your own Google address — a service account is a technical identity you create in Google Cloud.
required
gw_sa_private_keysecret
Service-account private keyThe private_key from the service-account JSON key — the full PEM block (-----BEGIN PRIVATE KEY----- … -----END PRIVATE KEY-----). This is NOT your Google account password. Stored encrypted in the vault and shown only once. Maps to GW_SA_PRIVATE_KEY.
required
gw_subject_defaultstring
Default userWorkspace user the integration impersonates when a tool call omits an explicit user, e.g. an assistant mailbox. Must exist in your Workspace domain. This IS a normal person's address, unlike the service-account email above.
required
gw_admin_subjectstring
Admin userSuper-admin email used for Admin Directory lookups. Optional — falls back to the default user (which then also needs the admin.directory scope).
optional
gw_surfacesstring
SurfacesComma-separated areas to enable: calendar, gmail, drive, directory, people. Omit for all. Tools and requested scopes are scoped to this list.
optional
gw_delegated_scopesstring
Delegated scopes (override)Advanced: comma/space-separated OAuth scope list to request instead of the surface-derived defaults. Must match what you authorise in the Admin console. Leave empty to use the defaults.
optional
gw_token_urlstring
Token endpoint (override)Advanced: OAuth2 token endpoint. Defaults to https://oauth2.googleapis.com/token.
optional
gw_max_bytesstring
Max response size (bytes)Caps a single API response to prevent memory blow-ups on large reads. Default 1048576 (1 MiB).
optional
gw_cache_ttl_secondsstring
Read cache TTL (seconds)How long identical read queries are cached in-process. Writes always bypass + clear the cache. Default 60.
optional
enable_writesboolean
Enable writesWhen ON, also registers the write tools: calendar (create/update event), gmail (send/draft mail), sheets (gw_sheet_write values, gw_sheet_add_tab, gw_sheet_duplicate_tab, and gw_sheet_batch_update for full formatting/formulas) and drive (gw_drive_create). Requires the matching write scopes to be authorised. Default OFF (read-only).
optional

permissions

memory

reads: [0] · writes: [0]

graph

reads: [0] · writes: [0]

network

outbound: [7]

filesystem

scratch: false