Skip to main content

Google Drive Integration

Connect files and folders from Google Drive to an xMagic Drive folder so your agents can search and use them. xMagic imports and indexes what you select once, then keeps it in sync. You decide whether changes only flow from Google Drive into xMagic, or whether agents can also write back to Google Drive.

This guide uses a running example: a Release Notes folder in Google Drive that a release assistant agent should read and, later, update.

WhereWhat you do there
xMagic DriveCreate the folder, connect Google Drive and choose how it syncs
Google sign-in and file pickerApprove access and pick the files and folders to sync
xMagic ComposerGive an agent access to the synced folder

Choose how changes sync​

Every Google Drive integration pulls changes from Google Drive. Two-way sync is optional and also pushes the agents' changes back.

ModeGoogle Drive → xMagicxMagic → Google Drive
Pull only (default)Changes to the files and folders you selected are reflected in xMagicNothing. Agent changes stay in xMagic.
Two-waySame as pull onlyAgents can edit or delete synced files, and create files in folders that are linked to a Google Drive folder

For example, with two-way sync, when the agent edits Release Notes/November release in xMagic, the new version is saved to the same file in Google Drive. With pull only, the edit stays in xMagic and the Google Drive file is untouched.

When changes move:

  • Google Drive → xMagic: on the schedule you set, or whenever you select Sync Now in Integration Details.
  • xMagic → Google Drive: right after the agent makes the change. Changes that could not be saved are retried on the next sync.

Before you start​

You need:

  • Access to xMagic Drive and to the agent you want to connect.
  • A Google account that can open the files and folders you want to sync. For two-way sync, it must also be able to edit them.
  • Popups allowed for xMagic in your browser. Google sign-in and the file picker open in popups.

Step 1: Choose an xMagic folder​

  1. In xMagic, open Drive.
  2. Create a folder (for example Release Notes) or open an existing one.
  3. Select Add data → Google Drive.
One integration per folder tree

A folder can't get a sync integration if the folder itself, one of its parent folders or one of its subfolders already has one. Choose a separate folder instead.


Step 2: Sign in and select files​

  1. Select Import from Google Drive and sign in with your Google account. xMagic asks for read-only access at this point. Edit access is only requested later, if you turn on two-way sync.
  2. In the Google file picker, select the files and folders to sync. You can pick:
    • folders, which bring in everything inside them,
    • Google Docs, Sheets and Slides,
    • Word, Excel and PowerPoint files, PDFs and text files.
  3. Under Review your selection, check the list. Use Add more files to pick more, Replace selected files to start the selection over, or the × next to an item to remove it. Then select Continue.
Where agents can create new files

Agents can always create files inside the synced Google Drive folders, such as Release Notes/2026. To let them create files at the top level of the xMagic folder too, select a single Google Drive folder. With several folders, or with only individual files, xMagic can't know which Google Drive folder a new top-level file belongs to.


Step 3: Configure syncing​

  1. Enter a Description of the content, for example Release notes. It is required.

  2. Turn on Use OCR if the files include scanned documents or images with text you want the agent to read.

  3. To pull changes on a schedule, turn on Sync files automatically and enter the Sync interval (minutes). The minimum is 60 minutes and the default is 1440 minutes (once a day). The interval counts from the end of the previous sync.

  4. For two-way sync, turn on Push xMagic changes to Google Drive, select Grant access and approve edit access with the same Google account. The row then shows Edit access granted. Finish stays disabled until you do this.

    Google's consent screen asks for access to your whole Drive, because xMagic needs it to edit files it didn't create. xMagic still only syncs and changes the files and folders you selected.

  5. With two-way sync on, choose what happens under If a file changed in both places since the last sync:

OptionWhat happensExample: the agent and a colleague both edited November release
Always keep xMagic changes (default)The xMagic version overwrites the Google Drive fileThe agent's version is saved to Google Drive
Always keep Google Drive changesThe Google Drive version replaces the agent's changeThe colleague's version is copied into xMagic and the agent's edit is dropped
  1. Select Finish. xMagic imports and indexes the files. This can take a while for large folders.

You can change the description, schedule, OCR, two-way sync and the conflict option later in Integration Details (see Manage the integration).


Step 4: Give an agent access to the folder​

  1. In Composer, open the agent's Configuration.
  2. Under Folders, select the synced folder. You can also pick just a subfolder. For example, attaching Operations/Release Notes shows it to the agent as drive://Release Notes/.
  3. Choose what the agent may do in that folder:
PermissionThe agent canNeeded for
NoneRead and search filesAnswering questions about the files
CreateCreate filesDrafting a new release note
UpdateEdit filesCorrecting an existing release note
DeleteDelete filesRemoving an outdated release note
Confirm deleteAsk you to approve each deletion first (available once Delete is on)Keeping a person in control of deletions
  1. Select Save.
warning

With Delete on and Confirm delete off, the agent can delete files without asking. With two-way sync, those files are also deleted in Google Drive.

These permissions apply in xMagic. With two-way sync, the Google account must also be allowed to make the same change in Google Drive.


Step 5: Test it​

Wait until the import finishes, then:

  • Pull only: ask the agent about a synced file, for example "What changed in the November release?". Then edit the file in Google Drive, select Sync Now and ask again.
  • Two-way: turn on Create and ask the agent to create a sample file in a synced folder, for example "Create a draft called release-checklist.md in Release Notes". Check that the file appears in that Google Drive folder.

Manage the integration​

In Drive, open the synced folder's integration to see Integration Details:

ActionEffect
Sync NowPull the latest Google Drive changes and push pending agent changes now
SaveApply changes to the description, sync schedule, OCR, two-way sync or conflict option
Go to FolderOpen the synced folder in Drive
DeleteRemove the integration

If you turn on two-way sync later, select Grant access to approve edit access before saving.


Troubleshooting​

ProblemWhat to check
Nothing happens when you select Import from Google Drive or Grant accessAllow popups for xMagic in your browser and try again.
xMagic says you have not approved all required permissionsIn Google's consent screen, tick every access xMagic asks for.
A file is missing in xMagicYou signed in with the right Google account, that account can open the file, and the file is one of the supported types. Select Sync Now to pull the latest changes.
An agent change didn't reach Google DrivePush xMagic changes to Google Drive is on, the Google account can edit the file or folder, and the agent has the right permission in Composer. For a deletion, check whether Composer is waiting for your approval.
The agent can't create a file at the top of the folderThe integration syncs several Google Drive folders, or only individual files, so xMagic doesn't know where the file belongs. Ask the agent to create it in a synced subfolder, or connect a single Google Drive folder.
A new file wasn't created in Google DriveA file with the same name already exists in that Google Drive folder. Google Drive allows duplicate names, so xMagic doesn't create a second one. Ask the agent to use a different name.