Prerequisites
- A Google Drive folder containing the content you want indexed.
- Either a Google Cloud service account (recommended for ongoing syncs) or a short-lived OAuth access token.
- A BeforeQuery workspace
ownerrole.
Set up the connector
1
Create a service account and key
In the Google Cloud console, create (or reuse) a project, enable the Google Drive API, and create a service account. Download its JSON key file.
Prefer a service account over an access token — access tokens expire within about an hour, so scheduled syncs will fail once the token lapses.
2
Share the folder with the service account
Copy the service account’s email address (
…@…iam.gserviceaccount.com) and share the Drive folder with it (Viewer access is enough), just as you would with a teammate.3
Find the folder ID
Open the folder in Drive and copy the ID from the URL:
https://drive.google.com/drive/folders/<folder-id>.4
Add the source in BeforeQuery
In the dashboard, open Project → Sources → Add source and choose Google Drive. Paste the service account JSON (the full key-file contents) and the folder ID, then click Add. The first sync starts automatically.
Connection settings
Keeping content in sync
Click Sync on the source card, or set a daily/weekly schedule. New and edited files in the folder are picked up on the next sync; unchanged files are skipped.Troubleshooting
- Sync succeeds but finds nothing? The folder isn’t shared with the service account, or the folder ID points somewhere else. Re-check the share and the ID.
- Sync worked once, then started failing? You used an access token, and it expired. Switch the source to a service account key.
- Sensitive files in the folder? PII masking applies at ingest, and you can mark specific documents
restrictedso they only answer for your team.