About Google Workspace
Google Workspace (formerly G Suite) connects Serval to your organization’s Google tenant so you can automate day-to-day IT and admin tasks - managing users, groups, aliases, calendar resources, and more - directly from Serval workflows. It also lets Serval index your Google Drive content so it can be searched as a knowledge source. You can connect using one of three methods, and which one you choose determines what Serval can do. Standard OAuth (“Sign in with Google”) is enough for basic user and group management. A Service Account with domain-wide delegation unlocks Knowledge Base (Drive) sync and Gmail delegation in addition to everything OAuth supports. Your own OAuth app uses a client you register in your own Google Cloud project, which reaches Docs, Sheets, Forms, Drive, and Calendar without domain-wide delegation. Authentication: OAuth 2.0 (Sign in with Google) for basic user/group management, your own OAuth app for document and calendar work without impersonation, or a Service Account with domain-wide delegation for full capabilities including Drive knowledge sync and Gmail delegation. Data sync: Background sync of users, groups, and group members on a recurring schedule; Drive content is indexed continuously on connections granted a Drive scope. Automation and provisioning workflows run on demand.What the Google Workspace integration enables
Calendar workflows
The Manage Google Calendar Event Attendees workflow requires a Google Workspace service-account connection with domain-wide delegation and permission to edit the calendar. Use the Service Account setup below for this workflow, not either OAuth connection method. The Manage Google Calendar Event Attendees workflow adds or removes attendees from an event. Enter email addresses separated by commas. Repeated additions count once, even when their capitalization differs. Addresses that remain on the event aren’t added again. The attendee and invitation response workflows save changes only if the event version still matches the one they read. If someone changes the event in the meantime, the workflow stops with a version conflict. Run it again to read the latest event before applying your changes. If the event response has no usable version identifier, the workflow stops without changing the event. The Recommend Available Meeting Room workflow uses the target user’s first listed office location when you omit the building. The calendar invitation response workflow requests update notifications for all event guests. A successful workflow means Google accepted the update request. It doesn’t confirm notification delivery.Save workflow attachments to Drive
Workflows can save Serval attachments, including signed PDFs, to a Google Drive folder. Ask Catalyst to add an upload step to your workflow and provide the destination folder. The workflow can use the attachment returned by an earlier step and preserve its filename. Your Google Workspace connection needs a Drive scope that permits creating files and write access to the destination folder. The standard user and group management scopes alone do not grant Drive upload access.Get your credentials
How you set up credentials depends on the connection method you choose.- Service Account
- Sign in with Google
- Your own OAuth app
- Let Serval impersonate the service account without a key. This is the default for Serval Cloud.
- Create a JSON key. Self-hosted deployments require this path, and Serval Cloud also supports it.
Before you start
Service account setup uses two separate admin systems:- A Google Workspace super admin must authorize domain-wide delegation.
- A Google Cloud project administrator must create and configure the service account.
- A Google Cloud Organization Policy Administrator (
roles/orgpolicy.policyAdmin) is required only when Domain Restricted Sharing blocks Serval’s external principal. The JSON key path avoids this policy change.
Create a Google Cloud project and service account
Enable the required APIs
- Admin SDK API for user and group management
- Google Drive API for Drive and Knowledge sync
- Google Sheets API for Sheets export
- Gmail API for Gmail delegation
- IAM Service Account Credentials API for both Serval-managed impersonation and the JSON key path
Serval Cloud without a key - allow Serval's principal in Domain Restricted Sharing
iam.allowedPolicyMemberDomains) blocks external principals from IAM grants, so we need to add Serval’s customer ID to the policy before we can grant access. This requires the Google Cloud Organization Policy Administrator role (roles/orgpolicy.policyAdmin) on the project, or help from someone who has it.- Open Google Cloud Organization Policies.
- Select the project that owns the service account in the resource picker.
-
Open Domain Restricted Sharing (
iam.allowedPolicyMemberDomains), then click Manage policy. - Select Override parent’s policy, then click Add a rule.
- Under Policy values, select Custom. Under Policy type, select Allow.
-
Keep every existing allowed value, including your own Google Workspace customer ID, and add:
- Save the policy and wait several minutes for it to propagate.
Alternative path: use the Google Cloud CLI
Alternative path: use the Google Cloud CLI
gcloud CLI using Google’s installation instructions:domain-restricted-sharing.yaml. Copy every existing allowedValues entry from the effective policy, then add Serval’s customer ID:EXISTING_ALLOWED_VALUE line for every value in the effective policy. Replace PROJECT_ID with the project that owns the service account.Apply the project-level override:describe command again without changing its arguments. Confirm that the effective policy contains every original value and is:C04gvbkuc.Serval Cloud only - grant Serval permission to impersonate your service account
app.serval.com) - copy and paste exactly:app.eu1.serval.com) - copy and paste exactly:Create a JSON key (self-hosted, or as a Serval Cloud alternative)
gcloud:Copy the numeric Client ID
116634191637610572786. You’ll use it in Google Admin.Authorize domain-wide delegation in the Admin console
Connect in Serval
The connect form differs depending on the method you chose.- Service Account
- Sign in with Google
- Your own OAuth app
Google Workspace domain
workspaceDomain is required.Service Account email
client_email from the JSON key. If left empty, Serval rejects the form with serviceAccountEmail is required. This value is shown again when you edit the connection so it round-trips into the form.Default subject
defaultSubject is required.Scopes
scopes are required.All Scopes (recommended) - copy/paste:Service Account Key (JSON)
- An empty value:
serviceAccountJson is required - Invalid JSON:
serviceAccountJson is not valid JSON - The wrong type:
serviceAccountJson must have type="service_account" - A missing client email:
serviceAccountJson is missing client_email - A missing or malformed private key:
serviceAccountJson is missing or malformed private_key
serviceAccountJson is required error fires only when no key resolves from any source - the key you submit, then (when editing) the key already on file, then your deployment’s platform-level key - so on Serval Cloud, where the platform-level key is configured in both regions, leaving this field empty does not trigger it.If you do upload a key, make sure it is the service account’s key file - it starts with {"type": "service_account", ...} - not the OAuth client JSON.Verifying the connection
Before connecting in Serval, confirm these setup steps are complete:- Test Google Workspace Connection verifies Serval can authenticate with Google. On success:
Successfully authenticated with Google Workspace Admin API. On failure:Unable to connect to Google Workspace. Please verify your OAuth token or service account credentials are valid and have the necessary Admin SDK API access., or, when the Admin SDK API is turned off in the Google Cloud project behind the connection,The Admin SDK API is not enabled in the Google Cloud project behind this connection, so user and group sync will fail until it is enabled there. - List Google Workspace Users lists a small sample of users. On success:
Successfully listed users from Google Workspace (sample size: N). On failure:Unable to list users from Google Workspace. Please verify your credentials have the 'admin.directory.user' or 'admin.directory.user.readonly' scope. - List Google Workspace Groups lists a small sample of groups. On success:
Successfully listed groups from Google Workspace (sample size: N). On failure:Unable to list groups from Google Workspace. Please verify your credentials have the 'admin.directory.group' or 'admin.directory.group.readonly' scope. - Test Google Drive API Access checks Drive access used for Knowledge Base sync. On success:
Successfully accessed Google Drive API (sample files found: N). On failure it begins withUnable to access Google Drive API.followed by a branch-specific explanation. - List Google Shared Drives checks access to Shared Drives (Team Drives). On success:
Successfully listed Shared Drives from Google Workspace (found: N). On failure it begins withUnable to list Shared Drives.followed by a branch-specific explanation.
Scope reference
Use this table to customize your scope set. All scopes are prefixed withhttps://www.googleapis.com/auth/.
Admin Directory
Gmail
Calendar
Drive and Knowledge Base
Sheets
Platform
Optional add-on scopes
Add these to the All Scopes list (in both Google Admin and Serval) only if you use the corresponding installable workflows:admin.directory.user, which is already in every scope set. Google places the archived account on an Archived User license automatically, so your Workspace must have Archived User licenses available.Gotchas and troubleshooting
The scopes must be granted in BOTH places, including cloud-platform
The scopes must be granted in BOTH places, including cloud-platform
https://www.googleapis.com/auth/cloud-platform. Serval auto-appends this scope when minting tokens, but Google’s delegation layer still rejects the request unless it’s explicitly present in the Admin grant. Minimal scope sets that omit cloud-platform will fail.'impersonate: status code 403' or 'failed to generate credentials for Google impersonated service account'
'impersonate: status code 403' or 'failed to generate credentials for Google impersonated service account'
impersonate: status code 403: ... referencing the IAM Service Account Credentials API); some Serval logs and status surfaces still show the generic failed to generate credentials for Google impersonated service account wording. Either way, this points to one of: a missing cloud-platform scope, a missing “Service Account Token Creator” role on the target service account, or the IAM Service Account Credentials API not being enabled. Confirm cloud-platform is in your scope list, the required API is enabled in your Google Cloud project, and the correct principal has Service Account Token Creator on your service account. On Serval Cloud keyless setups, that principal is Serval’s service account for your region (US: serval@serval-424322.iam.gserviceaccount.com; EU: serval-eu1@serval-424322.iam.gserviceaccount.com). If you uploaded a JSON key, it’s your service account itself (the self-grant) - once a key is on file, grants to Serval’s principal no longer apply.'Admin SDK API has not been used in project ... or it is disabled'
'Admin SDK API has not been used in project ... or it is disabled'
User sync works but Drive doesn't (the silent-spinner symptom)
User sync works but Drive doesn't (the silent-spinner symptom)
SERVICE_DISABLED, a 403/Forbidden, or a 401/unauthorized) even though Knowledge sync works. The failure messages tell Service Account users to ignore the result if Knowledge sync is working. If a Drive message references the OAuth proxy project, that’s a Serval-platform concern and not something you can fix in your own Google Cloud project.Validate at connect time - background sync won't show the error
Validate at connect time - background sync won't show the error
Connect-time validation only probes the directory when a directory scope is present
Connect-time validation only probes the directory when a directory scope is present
admin.directory.user.readonly, otherwise admin.directory.user) is in your submitted list. Drive-, Gmail-, or Calendar-only connections are not forced to add a directory scope just to pass validation. The group readonly scope does not satisfy this probe.Serval Cloud works keyless or with an uploaded key; self-hosted needs the JSON key
Serval Cloud works keyless or with an uploaded key; self-hosted needs the JSON key
The stored JSON key is never shown back; empty on edit means keep it
The stored JSON key is never shown back; empty on edit means keep it
Resetting an OAuth connection to a completely clean state
Resetting an OAuth connection to a completely clean state
Need help? Contact support@serval.com for assistance with your Google Workspace integration.

