Google Drive Bubble
Google Drive integration for file management
Quick Start
import { GoogleDriveBubble } from '@bubblelab/bubble-core';
import { CredentialType } from '@bubblelab/shared-schemas';
const result = await new GoogleDriveBubble({
operation: 'upload_file',
credentials: {
[CredentialType.GOOGLE_DRIVE_CRED]: process.env.GOOGLE_DRIVE_CRED as string,
},
}).action();
Operation Details
upload_file
- Input Schema
- Output Schema
operation'upload_file' required- Upload a file to Google Drive
namestring required- Name for the uploaded file
contentstring required- File content as base64 encoded string or plain text
mimeTypestring- MIME type of the file (auto-detected if not provided)
parent_folder_idstring- ID of the parent folder (uploads to root if not provided)
convert_to_google_docsboolean- Convert uploaded file to Google Docs format if possible
credentialsRecord<CredentialType,string>- Object mapping credential types to values (injected at runtime)
operation'upload_file' required- Upload a file to Google Drive
successboolean required- Whether the file was uploaded successfully
fileobject- Uploaded file metadata
errorstring required- Error message if operation failed
download_file
- Input Schema
- Output Schema
operation'download_file' required- Download a file from Google Drive
file_idstring required- Google Drive file ID to download
export_formatstring- Export format for Google Workspace files (e.g., "application/pdf", "text/plain")
credentialsRecord<CredentialType,string>- Object mapping credential types to values (injected at runtime)
operation'download_file' required- Download a file from Google Drive
successboolean required- Whether the file was downloaded successfully
contentstring- File content as plain text (for text-based files) or base64 encoded string (for binary files)
filenamestring- Original filename
mimeTypestring- MIME type of the downloaded file
errorstring required- Error message if operation failed
list_files
- Input Schema
- Output Schema
operation'list_files' required- List files and folders in Google Drive
folder_idstring- ID of folder to list files from (lists from root if not provided)
querystring- Search query to filter files (e.g., "name contains 'report'"
max_resultsnumber- Maximum number of files to return
include_foldersboolean- Include folders in the results
order_bystring- Order results by field (e.g., "name", "modifiedTime desc")
credentialsRecord<CredentialType,string>- Object mapping credential types to values (injected at runtime)
operation'list_files' required- List files and folders in Google Drive
successboolean required- Whether the file list was retrieved successfully
filesobject[]- List of files and folders
total_countnumber- Total number of files found
next_page_tokenstring- Token for fetching next page of results
errorstring required- Error message if operation failed
create_folder
- Input Schema
- Output Schema
operation'create_folder' required- Create a new folder in Google Drive
namestring required- Name of the folder to create
parent_folder_idstring- ID of the parent folder (creates in root if not provided)
credentialsRecord<CredentialType,string>- Object mapping credential types to values (injected at runtime)
operation'create_folder' required- Create a new folder in Google Drive
successboolean required- Whether the folder was created successfully
folderobject- Created folder metadata
errorstring required- Error message if operation failed
delete_file
- Input Schema
- Output Schema
operation'delete_file' required- Delete a file or folder from Google Drive
file_idstring required- Google Drive file or folder ID to delete
permanentboolean- Permanently delete (true) or move to trash (false)
credentialsRecord<CredentialType,string>- Object mapping credential types to values (injected at runtime)
operation'delete_file' required- Delete a file or folder from Google Drive
successboolean required- Whether the file was deleted successfully
deleted_file_idstring- ID of the deleted file
errorstring required- Error message if operation failed
get_file_info
- Input Schema
- Output Schema
operation'get_file_info' required- Get detailed information about a file or folder
file_idstring required- Google Drive file or folder ID to get info for
include_permissionsboolean- Include file permissions in the response
credentialsRecord<CredentialType,string>- Object mapping credential types to values (injected at runtime)
operation'get_file_info' required- Get detailed information about a file or folder
successboolean required- Whether the file information was retrieved successfully
fileobject- File metadata and information
permissionsobject[]- File permissions (if requested)
errorstring required- Error message if operation failed
share_file
- Input Schema
- Output Schema
operation'share_file' required- Share a file or folder with specific users or make it public
file_idstring required- Google Drive file or folder ID to share
email_addressstring- Email address to share with (for specific user sharing)
role'reader' | 'writer' | 'commenter' | 'owner'- Permission role to grant
type'user' | 'group' | 'domain' | 'anyone'- Type of permission to create
send_notificationboolean- Send notification email to the user
credentialsRecord<CredentialType,string>- Object mapping credential types to values (injected at runtime)
operation'share_file' required- Share a file or folder with specific users or make it public
successboolean required- Whether the file was shared successfully
permission_idstring- ID of the created permission
share_linkstring- Shareable link to the file
errorstring required- Error message if operation failed
move_file
- Input Schema
- Output Schema
operation'move_file' required- Move a file or folder to a different location in Google Drive
file_idstring required- Google Drive file or folder ID to move
new_parent_folder_idstring- ID of the new parent folder (moves to root if not provided)
remove_parent_folder_idstring- ID of the parent folder to remove (removes from all parents if not provided)
credentialsRecord<CredentialType,string>- Object mapping credential types to values (injected at runtime)
operation'move_file' required- Move a file or folder to a different location in Google Drive
successboolean required- Whether the file was moved successfully
fileobject- Updated file metadata after move
errorstring required- Error message if operation failed