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 lists files starting from a root folder (the Drive root by default, or a folder you scope it to) and walks every subfolder recursively. 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 mode. Both modes ask for a connection name and 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
By default the connector lists everything under its root that the authenticating identity can see. To narrow it, add one or more Google Drive folder URLs in the Knowledge base's Folder scope card; only files under those folders are ingested. With a service account, the practical scope is also bounded by what you 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
- 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.