Google Drive Connector
Connect Google Drive to a LlamaCloud project by signing in with Google or with a service account key file, and sync a Drive folder and its subfolders into a project folder.
The Google Drive connector syncs one Drive folder, subfolders included, into a connected folder. There are two ways to connect it, and they show up as separate cards in Add connection:
| Card | Signs in as | Pick this when |
|---|---|---|
| Google Drive | You, through a Google sign-in popup | You want to sync folders your own account can open |
| Google Drive Keys | A service account, from its JSON key file | You don’t want the connection tied to a person’s account |
Both are read-only. Shared drives and folders shared with the account both work.
Connect Google Drive by signing in
Section titled “Connect Google Drive by signing in”- On Files → Connections, click Add connection, pick Google Drive, and click Authorize.
- Sign in to Google in the popup and approve read access.
The connection reads whatever that Google account can read. If it’s a work account and the popup says your admin has to approve the app, that’s a Google Workspace setting on your side; send the request to your Workspace admin.
Connect Google Drive with a service account key
Section titled “Connect Google Drive with a service account key”A service account has its own identity and sees only what’s been shared with it. The connector doesn’t use domain-wide delegation, so it can’t act as other users in your Workspace.
- In the Google Cloud console, pick or create a project and enable the Google Drive API.
- Create a service account, then under Keys add a JSON key and download it. Google’s guide is Create credentials for a service account.
- Copy the service account’s email (it ends in
.iam.gserviceaccount.com) and share each Drive folder you want to sync with it. Viewer access is enough. - On Files → Connections, click Add connection, pick Google Drive Keys, and drop the JSON key file in. The form shows the service account’s email once it has read the file.
- Click Connect.
The form checks that the file is a service account key and not, say, an OAuth client secret, which is the usual mix-up. It doesn’t check the key with Google when you connect, so a key that’s been deleted or disabled won’t show a problem until you create a folder from it.
Create a folder from a Google Drive connection
Section titled “Create a folder from a Google Drive connection”From Files → New folder → Connected folder, pick your Drive connection.
- Signed-in connection: Google’s own folder picker opens. Choose one folder; everything in it syncs, subfolders included.
- Service account connection: there’s no picker, because a service account can’t browse your Drive. Paste the folder’s link (e.g.
https://drive.google.com/drive/folders/1AbCdEfGhIjK) or just the ID at the end of it. The folder has to be shared with the service account first.
Name the folder and click Create folder. If the connection can’t see the Drive folder you’ll get a “not found” or “denied access” error before anything is created. For a service account that almost always means the folder wasn’t shared with its email.
How the Google Drive connector syncs
Section titled “How the Google Drive connector syncs”After the first full copy, each sync reads Drive’s change feed and only handles what changed. Edited files are downloaded again. Files that are deleted, moved to the trash, or moved out of the synced folder are removed from your project folder.
Troubleshooting the Google Drive connector
Section titled “Troubleshooting the Google Drive connector”| Message | What to check |
|---|---|
| ”That file does not contain a service account key” or “This looks like a different kind of credentials file” | You uploaded an OAuth client file. Download a key from the service account’s Keys tab instead. |
| ”drive folder … not found” | The folder ID is wrong, or the folder isn’t shared with the connection’s account. |
| ”drive denied access to the resource” | The account can see the folder but not read it, or the Drive API isn’t enabled in the service account’s Google Cloud project. |