Google Workspace

Productivity OAuth Windmill docs

Manage users, groups and org units and read audit logs of a Google Workspace domain from any Windmill script, flow or app.

Set up in 2 steps

1

Connect from the Resources page

Open Resources, click Add a resource/API and pick gworkspace under Instance-configured OAuth APIs. Click Connect and sign in with a Workspace admin account, then name the resource and save it.

2

Run your first script

Fork any script below and read before writing anything.

Scripts

Building blocks, if none of the projects above fit. Fork one, run it, or call it as a step inside your own flow.

Submit a script →

Flows

Multi-step workflows that already wire Google Workspace to something else.

All flows →

Resource type

The shape of the credential every script on this page expects.

FieldTypeRequiredWhat it is
tokenstringYesOAuth token

Questions

What can Windmill do with my account?

It acts through the Admin Directory API, so it can read and change directory objects across the domain. Connect an account with the admin rights you intend, and no more.

Can scheduled flows run without an admin's OAuth session?

Yes, and for shared or scheduled flows that is the better lane: a connected resource acts as the admin who signed in and stops working if they leave. Store a service account key as a gcp_service_account resource and, in Admin console > Security > API controls > Domain-wide delegation, authorize its client ID for the admin.directory scopes (plus admin.reports.audit.readonly for audit logs). In a flow, run Get Access Token (Service Account) with an admin's email first and pass its result as the Google Workspace resource of the next steps.

Which scopes does the connection need?

The default connection grants admin.directory.user, .group, .orgunit and .user.security, which covers every script but List Activities. That one reads audit logs and needs admin.reports.audit.readonly, which you tick when connecting.

There is no Connect button on my instance

An instance admin has to add a Google OAuth client once, in Instance settings → Auth/OAuth/SAML → OAuth. Until then gworkspace is missing from the Instance-configured OAuth APIs list. A service account (above) works without it.