> ## Documentation Index
> Fetch the complete documentation index at: https://docs.automate.ax/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Automate.ax automations are TypeScript programs.
> Use Bun for installation and command examples.
> Use Automate.ax for the product name and automate.ax for the package, CLI, and domain.
> Treat documented public APIs as current; do not invent transitional or deprecated names.

# Google Drive

> Create, organize, share, and react to files in Google Drive.

Use `googleDrive` to manage files, folders, permissions, comments, replies, and shared drives. Drive triggers monitor one file, folder, or shared drive through Google Workspace Events.

## Connect Google

Connect a Google Account when you deploy. Automate.ax requests the narrowest scope that satisfies each callable. Google may require app approval for access outside files created or explicitly opened with the app.

File renaming, description and starred-state updates, folder moves, trashing, and restoring also accept `drive.metadata`. Use this permission for metadata operations on existing files without granting file-content access. These actions continue to request `drive.file` by default for app-authorized files. Downloading, exporting, uploading, and permanently deleting files require their own content or file-management permissions.

## Create the routing folders once

Add this temporary setup automation, deploy it, and select **Create routing folders** from the dashboard. Copy the two folder IDs from the run's action results, then remove the setup automation.

```ts automations/setup-drive-routing.automation.ts theme={null}
import { automation, onDashboardRun } from "automate.ax"
import { googleDrive } from "automate.ax/google-drive"

export default automation("Create Drive routing folders", () => {
  onDashboardRun({ title: "Create routing folders" })

  googleDrive.createFolder({ name: "Automation inbox" })
  googleDrive.createFolder({ name: "Automation review" })
})
```

## Move new Drive files

Replace both constants with the IDs returned by the setup run before deploying this automation.

```ts theme={null}
import { automation } from "automate.ax"
import { googleDrive } from "automate.ax/google-drive"

const incomingFolderId = "PASTE_AUTOMATION_INBOX_FOLDER_ID"
const reviewFolderId = "PASTE_AUTOMATION_REVIEW_FOLDER_ID"

export default automation("Route new Drive files", () => {
  const file = googleDrive.onFileCreated({
    resource: incomingFolderId,
    includeDescendants: true,
  })

  googleDrive.moveFile({
    fileId: file.fileId,
    addParentIds: [reviewFolderId],
  })
})
```

Use a Drive resource ID or standard Drive, Docs, or Slides URL as `resource`. Set `resourceType: "drive"` for a shared-drive ID or a shared-drive URL copied from Google Drive; copied shared-drive URLs use the same `/folders/` path as folder URLs. Only URLs containing `/drives/` identify shared drives automatically. Shared-drive subscriptions always include descendants. Subscriptions that include resource data expire after four hours; Automate.ax renews them automatically.

## Exports

```ts theme={null}
import {
  googleDrive,
  googleAccount,
  getGoogleDriveApi,
} from "automate.ax/google-drive"
```

* `googleDrive` contains the packaged Google Drive actions and triggers.
* `googleAccount("name")` selects a named Google connection.
* `getGoogleDriveApi` creates the authenticated Google Drive API helper for a custom account-backed action.

## Triggers

* [On access proposal created](/reference/integrations/google-drive/triggers/on-access-proposal-created)
* [On access proposal resolved](/reference/integrations/google-drive/triggers/on-access-proposal-resolved)
* [On approval cancelled](/reference/integrations/google-drive/triggers/on-approval-cancelled)
* [On approval completed](/reference/integrations/google-drive/triggers/on-approval-completed)
* [On approval created](/reference/integrations/google-drive/triggers/on-approval-created)
* [On approval reset](/reference/integrations/google-drive/triggers/on-approval-reset)
* [On approval reviewer responded](/reference/integrations/google-drive/triggers/on-approval-reviewer-responded)
* [On approval reviewers changed](/reference/integrations/google-drive/triggers/on-approval-reviewers-changed)
* [On comment created](/reference/integrations/google-drive/triggers/on-comment-created)
* [On comment deleted](/reference/integrations/google-drive/triggers/on-comment-deleted)
* [On comment edited](/reference/integrations/google-drive/triggers/on-comment-edited)
* [On comment reopened](/reference/integrations/google-drive/triggers/on-comment-reopened)
* [On comment resolved](/reference/integrations/google-drive/triggers/on-comment-resolved)
* [On Drive event](/reference/integrations/google-drive/triggers/on-event)
* [On file content changed](/reference/integrations/google-drive/triggers/on-file-content-changed)
* [On file created](/reference/integrations/google-drive/triggers/on-file-created)
* [On file deleted](/reference/integrations/google-drive/triggers/on-file-deleted)
* [On file moved](/reference/integrations/google-drive/triggers/on-file-moved)
* [On file renamed](/reference/integrations/google-drive/triggers/on-file-renamed)
* [On file trashed](/reference/integrations/google-drive/triggers/on-file-trashed)
* [On file restored from trash](/reference/integrations/google-drive/triggers/on-file-untrashed)
* [On permission created](/reference/integrations/google-drive/triggers/on-permission-created)
* [On permission deleted](/reference/integrations/google-drive/triggers/on-permission-deleted)
* [On permission edited](/reference/integrations/google-drive/triggers/on-permission-edited)
* [On reply created](/reference/integrations/google-drive/triggers/on-reply-created)
* [On reply deleted](/reference/integrations/google-drive/triggers/on-reply-deleted)
* [On reply edited](/reference/integrations/google-drive/triggers/on-reply-edited)

## Actions

* [Copy file](/reference/integrations/google-drive/actions/copy-file)
* [Create comment](/reference/integrations/google-drive/actions/create-comment)
* [Create folder](/reference/integrations/google-drive/actions/create-folder)
* [Create permission](/reference/integrations/google-drive/actions/create-permission)
* [Create reply](/reference/integrations/google-drive/actions/create-reply)
* [Create shared drive](/reference/integrations/google-drive/actions/create-shared-drive)
* [Delete comment](/reference/integrations/google-drive/actions/delete-comment)
* [Delete file](/reference/integrations/google-drive/actions/delete-file)
* [Delete permission](/reference/integrations/google-drive/actions/delete-permission)
* [Delete reply](/reference/integrations/google-drive/actions/delete-reply)
* [Delete shared drive](/reference/integrations/google-drive/actions/delete-shared-drive)
* [Download file](/reference/integrations/google-drive/actions/download-file)
* [Export file](/reference/integrations/google-drive/actions/export-file)
* [Get account](/reference/integrations/google-drive/actions/get-about)
* [Get comment](/reference/integrations/google-drive/actions/get-comment)
* [Get file](/reference/integrations/google-drive/actions/get-file)
* [Get permission](/reference/integrations/google-drive/actions/get-permission)
* [Get reply](/reference/integrations/google-drive/actions/get-reply)
* [Get shared drive](/reference/integrations/google-drive/actions/get-shared-drive)
* [Hide shared drive](/reference/integrations/google-drive/actions/hide-shared-drive)
* [List comments](/reference/integrations/google-drive/actions/list-comments)
* [List files](/reference/integrations/google-drive/actions/list-files)
* [List permissions](/reference/integrations/google-drive/actions/list-permissions)
* [List replies](/reference/integrations/google-drive/actions/list-replies)
* [List shared drives](/reference/integrations/google-drive/actions/list-shared-drives)
* [Move file](/reference/integrations/google-drive/actions/move-file)
* [Reopen comment](/reference/integrations/google-drive/actions/reopen-comment)
* [Resolve comment](/reference/integrations/google-drive/actions/resolve-comment)
* [Restore file](/reference/integrations/google-drive/actions/restore-file)
* [Trash file](/reference/integrations/google-drive/actions/trash-file)
* [Restore hidden shared drive](/reference/integrations/google-drive/actions/unhide-shared-drive)
* [Update comment](/reference/integrations/google-drive/actions/update-comment)
* [Update file](/reference/integrations/google-drive/actions/update-file)
* [Update permission](/reference/integrations/google-drive/actions/update-permission)
* [Update reply](/reference/integrations/google-drive/actions/update-reply)
* [Update shared drive](/reference/integrations/google-drive/actions/update-shared-drive)
* [Upload file](/reference/integrations/google-drive/actions/upload-file)
