DEV

Google Drive

Google Drive Connection

Put Google Drive to Work with @Human Automations and @Human Agents

The Google Drive Connection documents all Triggers, Actions and Query Operations available for creating automations via the Google Drive API.

What can you do with the Google Drive Connection?

  • Connect to the Google Drive API in a few clicks

  • Use the related Google Drive Operations (see below) in @Human Automations or @Human Agents

Trigger Operations

File Created

Triggers on: files/fileCreated

Triggered when a new file is created in Google Drive.

File Updated

Triggers on: files/fileUpdated

Triggered when an existing file is updated in Google Drive.

File Deleted

Triggers on: files/fileDeleted

Triggered when a file is deleted from Google Drive.

Folder Created

Triggers on: folders/folderCreated

Triggered when a new folder is created in Google Drive.

Action Operations

Action: Copy File

Action: Export File

Action: Create Folder

Action: Create File From Text

Action: Delete File

Action: Move File

Action: Move File

Action: Remove File Permission

Query Operations

Example link

Example link

Obtaining Access Credentials

To obtain a Personal Access Token (PAT) for Google Drive (system-to-system access via the UI), follow these steps:

Prerequisites

  • A Google Workspace account (personal Google accounts cannot generate PATs for system-to-system access).

  • Admin access to the Google Cloud Console (if setting up a service account).

Steps to Generate a PAT for Google Drive

  1. Go to Google Cloud Console

    • Sign in with your Google Workspace admin account.

  2. Create or Select a Project

    • Navigate to IAM & Admin > Manage Resources > Create Project (if needed).

  3. Enable the Google Drive API

    • Go to APIs & Services > Library.

    • Search for "Google Drive API" and enable it.

  4. Create a Service Account (for system-to-system access)

    • Go to IAM & Admin > Service Accounts > Create Service Account.

    • Fill in details (name, description) and grant Project Owner or Drive API roles.

    • Click Done.

  5. Generate a JSON Key (PAT Alternative for System Access)

    • In Service Accounts, select your account > Keys > Add Key > Create New Key (JSON).

    • Download the .json file (this acts as your credential for system access).

  6. Grant Drive Access to the Service Account (Optional)

    • If accessing specific files/folders, share them with the service account email (found in the .json file).


Token Usage: The .json key file contains credentials for OAuth2 authentication (not a traditional PAT). Use it in your application to generate short-lived access tokens via Google’s OAuth2 flow.

Configuring Webhooks

  1. Verify Your Domain

  2. Register Your Domain in Google Cloud Console

    • Navigate to the Google Cloud Console and select your project.

    • Go to APIs & Services > Domain Verification.

    • Click Add domain and enter your verified domain name.

  3. Configure the HTTPS Listener

    • Host an HTTPS server with a valid SSL certificate on the verified domain to listen for notifications.

  4. Subscribe to Notifications

    • Make a watch request to the resource you want to monitor (e.g., files.watch or changes.watch).

    • Include a unique Channel ID and the webhook URL (address) in the request body to initiate the notification channel.

Code (Apache v2.0): Service Connectivity and Metadata

Code (Apache v2.0): List of External Resources and Internal Mapping

Last updated