Google Drive Connector
The Google Drive connector syncs documents from Google Drive into a Knowledge base so an AI Employee (AIE) can search and cite that content. It reaches Drive through the Drive API v3 and supports two authentication modes: a service account that you share Drive content with, and a sign in with Google OAuth2 flow.
You set up a Google Drive connection from the Data sources tab of the Integrations page. Creating a connection is admin-only — builders never see credentials; they reference the resulting Knowledge base when configuring a workflow.
What it ingests
The connector reads the folders and files you scope each Knowledge base to and walks every subfolder recursively. Nothing syncs until you set that scope — there is no whole-Drive default. For each file it captures the Drive file ID, name, folder path, MIME type, size, and a change tag for incremental sync.
Native Google Workspace files are exported to Office formats automatically so the pipeline can extract their text:
| Google Workspace type | Exported as |
|---|---|
| Google Docs | Word (.docx) |
| Google Sheets | Excel (.xlsx) |
| Google Slides | PowerPoint (.pptx) |
Other Workspace types (Forms, Drawings, Maps, and the like) have no extractable export and are skipped. Regular uploaded files keep their own MIME type and are downloaded directly. Everything then flows through the shared ingestion pipeline (extract → chunk → embed → store) described in Data Connectors.
How to connect
Open the Data sources tab, select the Google Drive tile, and choose an Authentication Method — Service Account or Sign in with Google. Both ask for a connection name; Service Account mode also takes an optional description.
Service account
A service account authenticates server-to-server with no interactive sign-in. The connector signs a JWT with the service account's key and exchanges it for a read-only access token using the https://www.googleapis.com/auth/drive.readonly scope. The setup form asks you to paste the entire service-account JSON key file; Ema validates that it is type: service_account and contains client_email, private_key, and token_uri, then stores it encrypted.
The in-product setup guide walks you through Google Cloud:
- In the Google Cloud Console, create a service account (for example, "Ema Drive Connector") — no role assignment is needed.
- On the service account's Keys tab, choose Add key → Create new key → JSON and download the key file.
- Enable the Google Drive API for the project.
- In Google Drive, Share the folders (or a Shared Drive) you want to sync with the service account's
client_email, granting Viewer access. The connector can only see content explicitly shared with it.
Paste the JSON and select Create connection. The connection is validated against the Drive about endpoint before it is stored.
Sign in with Google (OAuth2)
OAuth2 mode connects with a Google account through the authorization-code flow. This mode is available only when Google Drive OAuth2 is configured on your Ema platform; the form shows a notice when it isn't. Enter a connection name, select Sign in with Google, approve the requested drive.readonly access, and Google redirects back to Ema, which stores the tokens encrypted and creates the connection automatically.
Token refresh. In OAuth2 mode Ema refreshes the access token with the stored refresh token before each sync, so the connection stays live without manual re-authentication.
Sync configuration
Scope and schedule are set on the Knowledge base built from the connection. One connection can feed several Knowledge bases scoped to different folders.
Folder scope
Nothing syncs until you set a scope — there is no whole-Drive default. Because Google Drive is browse-capable, you can scope a Knowledge base two ways:
- Pick visually. When you attach the connection, Ema opens a Choose files & folders to sync picker to browse the Drive and check the folders, files, or Shared Drives to ingest — checking a folder ingests everything inside it. Re-open it later with Edit files.
- Paste URLs. Or add Google Drive folder URLs in the Knowledge base's Folder scope card (e.g.
https://drive.google.com/drive/folders/...).
With a service account, the reachable scope is also bounded by what you have shared with it.
Schedule
In the Knowledge base's Sync configuration, set:
- Sync enabled — turn syncing on or off.
- Schedule — Interval (sync automatically, in minutes) or Manual (only on demand).
- Sync now — trigger a one-off sync at any time.
Syncs are incremental. For uploaded files the connector compares the file's md5Checksum; for exported Workspace files (which have no checksum) it uses the last-modified time. Unchanged files are skipped, so re-syncs only process what changed.
Limits and behavior
- Scope is required. A sync with no folder or file selected is rejected — Ema never crawls an entire Drive by default.
- Read-only. Both modes use the
drive.readonlyscope — the connector never writes to Drive. - Scope follows sharing (service account). A service account only sees content explicitly shared with it; share the right folders or add it to the Shared Drive as a Viewer.
- Supported file types only. Extractable types are PDF; Word, Excel, and PowerPoint (including exported Google Docs/Sheets/Slides); plain text, Markdown, CSV, HTML, and JSON; and images (
.png,.jpg,.webp,.gif) read via a vision model. Unsupported Workspace types are skipped. - OAuth2 token lifetime. If an OAuth2 access token expires mid-sync, the sync stops with a clear "access token expired" error; restart the sync to refresh and continue.
- Rate limits from Drive (HTTP 429/503) are retried with
Retry-Afterback-off, capped at five minutes per wait, up to three attempts.
What's next
- Data Connectors — the connection model, the ingestion pipeline, and how connectors compare to Tools.
- SharePoint Connector, Confluence Connector, Box Connector — the other source connectors.