Skip to main content

Google Drive

Performs Google Drive operations - manage files, folders, permissions, and shared drives.

MCP Tool Pack Available

Want to expose Google Drive actions as MCP tools for AI assistants? Use the Google Drive MCP Tool Pack to deploy all 22 tools in one step - no manual configuration needed.

Configuration

FieldTypeDefaultDescription
Service Account JSONsecret-Google service account credentials JSON (required)
Delegate Tostring-Email to impersonate via Domain-Wide Delegation
Actionselect-The Google Drive operation to perform (required)
File IDstring-File or folder ID for file-specific operations
File Namestring-File or folder name
Folder IDstring-Parent folder ID (defaults to root)
Destination Folder IDstring-Target folder for move operations
MIME Typestring-MIME type for export, upload, or create operations
Contentstring-Text content for file creation
File URLstring-URL to download file content from
Descriptionstring-File description
Emailstring-Email address for permission operations
RoleselectreaderPermission role: reader, writer, commenter, owner
Permission TypeselectuserPermission type: user, group, domain, anyone
Permission IDstring-Permission ID for removal
Querystring-Search query using Drive query syntax
Max Resultsinteger100Maximum results to return
StarredbooleanfalseWhether the file is starred
Folder Colorstring-Folder color as hex
Custom Propertiesstring-JSON object of custom properties
Shared Drive Namestring-Name for new shared drive
Target File IDstring-Target file for shortcut creation
Send NotificationbooleantrueSend email when sharing

Authentication

This processor supports two authentication methods: OAuth Connection (recommended for personal accounts) and Service Account (for server-to-server automation).

OAuth lets you authorize Qaynaq to act as your Google account. Files are owned by you, using your quota. You authorize once and it works indefinitely.

Follow the Google OAuth Setup guide to create a connection. Make sure to enable the Google Drive API and add the auth/drive scope. Then select your connection from the OAuth Connection dropdown in the processor configuration.

Option B: Service Account

Service accounts are best for Google Workspace organizations with Domain-Wide Delegation.

warning

Service accounts have their own 15GB storage quota. Files created by a service account count against its quota, even when placed in shared folders. For personal Google accounts, use OAuth instead.

Step 1: Create a Service Account

  1. Go to the Google Cloud Console
  2. Create a project or select an existing one
  3. Navigate to IAM & Admin > Service Accounts
  4. Click Create Service Account, give it a name, and click Done
  5. Click the service account, go to the Keys tab
  6. Click Add Key > Create new key > JSON
  7. Download the JSON key file

Step 2: Enable the Google Drive API

  1. In Google Cloud Console, go to APIs & Services > Library
  2. Search for Google Drive API and click Enable

Step 3: Store the Credentials

  1. Open the downloaded JSON key file and copy its entire contents
  2. In Qaynaq, go to Settings > Secrets
  3. Create a new secret (e.g. key: GOOGLE_DRIVE_SA) and paste the JSON as the value
  4. In the Google Drive processor, select GOOGLE_DRIVE_SA from the Service Account JSON dropdown

Step 4: Share Files with the Service Account

A service account cannot access any files by default. You must explicitly share files or folders with the service account's email address:

  1. Open the JSON key file and find the client_email field (e.g. my-service@my-project.iam.gserviceaccount.com)
  2. Open a Google Drive folder or file and click Share
  3. Paste the service account email and grant Editor access
  4. Click Send (you can uncheck "Notify people" since it's a service account)

Domain-Wide Delegation (Google Workspace only)

As an alternative to sharing individual files, Google Workspace administrators can grant the service account access to all users' files via Domain-Wide Delegation:

  1. In Google Cloud Console, go to the service account details
  2. Enable Domain-Wide Delegation and note the Client ID
  3. In Google Workspace Admin Console, go to Security > API Controls > Domain-wide Delegation
  4. Add the Client ID with the scope https://www.googleapis.com/auth/drive
  5. Set the Delegate To field to the email of the user whose files you want to access

Actions

File Management

Copy File

Create a copy of the specified file.

Get File

Retrieve file or folder metadata by its ID.

Find File

Search for a specific file by name.

Find or Create File

Find a file by name, or create a new one if not found.

List Files

Retrieve a list of files based on query parameters.

Rename

Update the name of a file or folder.

Update Metadata

Update file or folder metadata including name, description, starred status, and custom properties.

Move File

Move a file from one folder to another.

Delete File (Trash)

Move a file to the trash.

Delete File (Permanent)

Permanently delete a file. This action cannot be undone.

Create Shortcut

Create a shortcut to a file.

Content Operations

Create File From Text

Create a new file from plain text content.

Upload File

Upload a file to Google Drive from a URL or content.

Export File

Export Google Workspace files (Docs, Sheets, Slides) to different formats like PDF, Word, Excel.

Replace File

Upload new content to replace an existing file.

Folder Operations

Create Folder

Create a new, empty folder.

Find Folder

Search for a specific folder by name.

Find or Create Folder

Find a folder by name, or create a new one if not found.

Create Shared Drive

Create a new shared drive (Team Drive).

Permissions & Sharing

Add File Sharing

Add a sharing permission to a file. Provides a sharing URL.

Remove File Permission

Remove specific user access to a file.

Get Permissions

List all users who have access to a file.

Dynamic Fields

All action parameter fields support Bento interpolation functions, allowing dynamic values from message content using ${!this.field_name} syntax. This enables processing batches of file operations or reacting to upstream data. For example, setting File ID to ${!this.file_id} will read the file ID from the incoming message.

Static fields (not interpolated): Service Account JSON, Delegate To, Action.

Output Format

All actions return a structured JSON object:

  • File actions return a file object containing file metadata (id, name, mime_type, web_view_link, etc.)
  • Folder actions return a folder object with folder metadata
  • List actions (list_files, find_file, find_folder) return an array and a count field
  • Permission actions return permission details or a permissions list
  • find_or_create actions include a created boolean field
  • Delete actions return {deleted: true, file_id: "..."}
tip

Use a Mapping processor after Google Drive to extract specific fields from the response, such as the file ID or the sharing URL.