Skip to main content
Automagically is currently in a closed beta, and Google Workspace is a limited-availability part of it. Ask your Customer Success contact to turn Google Workspace on for your workspace before you look for the Google Workspace card.
Automagically can run runbooks in a client’s Google Workspace, the same way it runs them in Microsoft 365: create and offboard users, change group membership, set an out-of-office reply or forwarding, assign licenses, wipe a phone, and report on sign-ins and storage. Google has no GDAP, so each client lets Thread in once through domain-wide delegation, and Thread then acts as one Google admin you choose. This page covers how the connection works, what the client’s Google admin does, what you do in Automagically, what runbooks can do, and how to fix common problems.

How the connection works

Each client is connected in two layers, and you need both:
  1. The delegation (the client’s Google super admin, once per client). In the client’s Google Admin console, a super admin adds Thread’s app under domain-wide delegation, with the list of permissions (scopes) the connect dialog gives you. This allows Thread’s app to act in that domain.
  2. The connected admin (you, in Automagically, once per client). You enter one Google admin’s email and the client’s domain, then sign in to Google as that admin once. Thread checks the delegation works and saves the connection. Runs for that client then act as that admin.
If a client connects but some runbooks fail with a permissions error, the cause is usually layer 1: a scope is missing from the delegation.

Before you start

  • In Automagically: the Google Workspace card on the Integrations page. If you don’t see it, ask your Customer Success contact to turn on Google Workspace for your workspace.
  • Your Automagically permissions: Manage integrations to connect, test, change or disconnect a client or the staging domain. Without it, the Google Workspace pages are view only.
  • In each client’s Google Workspace:
    • A super admin who can add an app under domain-wide delegation.
    • An admin account for Thread to act as. A super admin is simplest. A delegated admin also works if its role includes Admin roles read and read access to users and domains, plus the privileges your runbooks need.
    • Someone who can sign in as that admin, once, in the window Thread opens.
  • Your browser allows pop-ups for this site. The Google sign-in opens in a new window.
  • Optional: a test Google Workspace domain for staging.

Set up Google Workspace

Open the connect dialog for a client

  1. In Automagically, go to Integrations. On the Google Workspace card, click the Connect clients row. The Google Workspace clients page lists your clients.
  2. On the client’s row, click Connect. A dialog titled Connect client name to Google Workspace opens with four steps.

Add Thread’s app in the client’s Google Admin console

The dialog gives the client’s super admin everything they need. Send them the details or do this together.
  1. Copy Thread’s client ID. Click the copy button next to the client ID.
  2. Copy the scopes. Click the copy button next to Scopes. This copies the full list, comma-separated.
  3. Add them in the Google Admin console. Click Open the Google Admin console, or go to Security → Access and data control → API controls → Manage domain-wide delegation. Click Add new, paste the client ID and the scopes, then click Authorize.
Paste both values exactly as copied. Don’t type them.

Sign in as the client’s Google admin

  1. In the dialog’s last step, Sign in as the client’s Google admin, enter:
    • Admin email: the Google admin Thread will act as. It must be on the client’s domain or one of its sub-domains.
    • Domain: the client’s domain, for example example.com.
  2. Click Sign in and connect. A Google sign-in window opens.
  3. Sign in as that admin, in that window. The sign-in asks Google for the admin’s identity only (openid email).
  4. The window shows Signed in to Google. Close it. Thread finishes the connection in the tab where you clicked Sign in and connect.
  5. Back in Automagically, you see Google Workspace connected. and the client’s status shows Connected.
The connection only finishes in the tab where you started it. If the client’s admin signs in themselves, they do it in the window that opens on your screen. Before it saves the connection, Thread checks, in this order:
  • Google gives Thread a token for that admin with the required admin scopes, which shows the delegation is in place.
  • The account exists and is a Google admin (super admin or delegated admin).
  • The admin can read admin roles.
  • The domain belongs to that Google Workspace. A secondary domain works, and Thread uses the account’s primary domain.
  • The two Gmail settings scopes are delegated.
If a check fails, the client shows Failed with the reason, and the dialog shows Last attempt failed: with it the next time you open it. See Fix common problems.

Connect a staging domain (optional)

On the Google Workspace card, click Connect on the Connect staging domain row. The Connect a staging Google Workspace dialog has the same steps. Use a test domain: it links a test Google Workspace so you can try runbook changes before they reach clients.

Google scopes

The connect dialog asks for 22 scopes. The first 13 are required: the client can’t connect unless all of them are delegated. The other 9 are optional. The client still connects without them, and only the runbooks that need them fail. Every scope starts with https://www.googleapis.com/auth/. Copy the list from the dialog rather than from this table. The Gmail scopes only change mailbox settings. None of the scopes Thread asks for lets it read email. Optional scopes added later. If the client adds an optional scope after connecting, Thread can keep using what it last knew for up to 6 hours. Click Test on the client’s row right after the change, then run again.

The connected admin’s role

The delegation sets the maximum. The connected admin’s own Google role still decides what each run can do: Google refuses any step the role doesn’t allow.

Automagically permissions

Without Manage integrations, the Google Workspace clients page shows a View only tag.

What runbooks can do in Google Workspace

Google runbooks call Google’s APIs as the connected admin, or as the mailbox owner for Gmail settings. What they do is limited to the steps inside the approved runbook, the delegated scopes and the admin’s role.
  • Users: create a user, suspend a user, sign a user out everywhere, reset a password, reset 2-step verification backup codes, and onboard a user (create the account, assign a license, add to groups).
  • Groups: add or remove a group member.
  • Gmail settings: set an out-of-office reply, set or turn off forwarding, add a mailbox delegate, add a send-as address.
  • Licenses: assign or remove a Google Workspace license.
  • Devices: disable a Chromebook, block or wipe a mobile device.
  • Reports (read only): sign-in activity and usage.
  • Shared drives: list and create Shared drives, and add and remove members, in runbooks that declare they need Drive.
Dropdowns in run forms, such as users, groups, licenses, organizational units and domains, are read from the client’s Google Workspace. What they can’t do
  • Read, search or send email. Gmail steps only change mailbox settings.
  • Reset the password or backup codes of a Google admin, or of a user who holds an admin role directly or through a group.
  • Use the Calendar, admin role management, full mobile device management, custom user fields or alerts scopes. They are asked for, but no Google step uses them yet.
Other steps that change a user who holds an admin role are refused too. If Google can’t confirm whether the target holds an admin role, the step is refused. In that case, make the change in the Google Admin console.
Adding a mailbox delegate lets that user read, send and delete mail in the mailbox. Check that a request is genuine before you approve or run a runbook that does it.

Confirm the connection works

  1. Check the client’s status. In Automagically, go to Integrations → Google Workspace → Connect clients. The client shows Connected, with its domain and admin. The card shows how many clients are connected, for example 1 client connected.
  2. Click Test. On a connected client’s row, click Test. For the staging domain, use the ⋮ menu → Test. Thread checks the connection with Google again and shows “Connected to” followed by the domain.

What technicians see

If a client isn’t connected, a run is blocked with: Google Workspace is not connected for client “client name”. Connect it in the admin app before running this automation. A staging test with no staging domain connected is blocked with: Google Workspace staging is not connected. Connect it in the admin app before testing in staging.

Change the admin or disconnect

Disconnecting in Automagically doesn’t remove Thread’s app from the client’s Google Admin console. To remove it there, the client’s super admin deletes Thread’s client ID under Manage domain-wide delegation.

Fix common problems

FAQ

No. The client’s super admin only adds Thread’s client ID and the scopes under domain-wide delegation in the Google Admin console.
No scope Thread asks for reads mail. The two Gmail scopes only change settings: out-of-office, forwarding, delegates and send-as.
The connected admin you chose when you connected the client. For Gmail settings, the step acts as the mailbox owner.
Connect another admin with Change admin or Reconnect. Click Test to see why a connection stopped working.
Their super admin deletes Thread’s client ID under Manage domain-wide delegation in the Google Admin console.