Connect Google Drive
A Google Drive source keeps a collection in step with a Drive folder and everything below it, including folders inside a shared drive. The platform reads as a service account — a robot identity you create in Google Cloud — so nobody has to sign in.
Everything Connect a source says about schedules, Sync now, the run log and what happens when a file is edited, removed or deleted applies unchanged. This page covers what is specific to Drive.
Before you start: a service account and a shared folder
Section titled “Before you start: a service account and a shared folder”The simplest setup needs no Workspace administrator:
- In the Google Cloud console, pick or create a project and enable the Google Drive API for it.
- Under IAM & Admin → Service accounts, create a service account. No roles are needed.
- Open the account, go to Keys, and add a key of type JSON. A file downloads; keep it, you will paste its contents.
- In Drive, share the folder you want to sync with the service
account’s email address (it ends in
.iam.gserviceaccount.com), as a Viewer.
If you would rather the platform read as a person — every folder that
user can see, without sharing each one — an administrator can grant the
service account domain-wide delegation for the scope
https://www.googleapis.com/auth/drive.readonly in the Admin console,
and you set Impersonate user below. Sharing the folder is not
needed in that case.
Add the source
Section titled “Add the source”Open a collection’s Sources tab, choose Add source, pick Google Drive, and fill in:
- Folder — the folder’s URL as copied from Drive, or its id.
- Service account key (JSON) — the whole downloaded key file, pasted. It is stored encrypted and never shown again.
- Under Advanced, Impersonate user — only with domain-wide delegation, the Workspace user to act as.
Test connection looks the folder up and lists one page of it — the same calls a sync makes — so an unshared folder, a bad key and a missing delegation each fail here with a message that says which.
What becomes a document
Section titled “What becomes a document”Every file below the folder whose type the platform can parse, plus Google’s own formats, which are exported on the way in:
| In Drive | Ingested as |
|---|---|
| Google Docs | Word document (.docx) |
| Google Sheets | Excel workbook (.xlsx) |
| Google Slides | PowerPoint deck (.pptx) |
Drawings, Forms, Sites, shortcuts and unsupported file types are skipped silently. Trashed files are never listed.
A Docs, Sheets or Slides file over 10 MB cannot be exported — that is a limit of the Drive API, not of the platform. Such a file is reported as failed in the run log with a message saying so; download it from Drive yourself and upload it to the collection.
The document’s citation link is the file’s own Drive URL.
How changes are detected
Section titled “How changes are detected”Each run walks the folder tree and compares each file’s checksum (or, for Google’s own formats, its revision number) with what it saw last time; an unchanged file is not downloaded. After the first run, only files modified since the previous run are listed at all. A file removed from the folder, moved elsewhere or trashed disappears from the listing and its document is paused, then deleted after the grace period.
Test-connection messages
Section titled “Test-connection messages”- is not valid JSON / is not a service account key file — paste the whole downloaded key file, unchanged.
- the service account key is invalid or revoked — create a new key under the service account’s Keys tab.
- the folder or file was not found, or is not shared with the service account — share the folder with the service account’s email, or check the folder id.
- domain-wide delegation is not granted… — the Impersonate user setting needs an administrator to grant the read-only Drive scope to this service account’s client id.
- ‘X’ is a file, not a folder — the URL points at a document; use the folder that contains it.
