ComponentsActions

Google Drive

Upload, download, share, and organize Google Drive files and folders from inside an agent workflow.

Google Drive actions let an agent work with files and folders directly in a flow. An agent can upload, download, copy, share, list, and delete files, and create folders, then pass the results to later steps.

Supported actions

GroupActions
FileUpload, Download, Copy, Share, List, Delete
FolderCreate

Prerequisites

How to use these actions

  • Map text inputs from earlier steps. Inputs such as File Name, File ID, and Query accept a value mapped from a previous step.
  • Selections and toggles take fixed values. The Role, Permission Type, and File Return Mode selections, the Include Trashed and Send Notification Email toggles, and Max Results are entered directly rather than mapped from a previous step.
  • File content is base64 encoded. Pass uploaded file content as a base64 encoded string in File Content Base64.
  • Leave a parent folder empty for the root. When a parent folder input is empty, the file or folder is placed in the root of the Drive.
  • List filters with query syntax. The List action filters with Google Drive query syntax, such as name contains 'report'.

Actions

File

Google Drive File Upload

Uploads a new file to Drive.

InputRequiredDescription
File NameYesThe name of the file to create.
File Content Base64YesThe file content as a base64 encoded string.
Parent Folder IDNoThe folder to place the file in. Leave empty for the root folder.
Content TypeNoThe MIME type of the file, such as application/pdf.

Google Drive File Download

Downloads a file from Drive.

InputRequiredDescription
File IDYesThe unique identifier of the file to download.
File Return ModeNoHow to return the file, either Content for a base64 string or Url for a download link. Defaults to Content.

Google Drive File Copy

Copies an existing file.

InputRequiredDescription
File IDYesThe unique identifier of the file to copy.
New File NameNoThe name for the copy. Defaults to the original name prefixed with "Copy of".
Parent Folder IDNoThe folder to place the copy in. Defaults to the original file's folder.

Google Drive File Share

Shares a file with a person or creates a public link.

InputRequiredDescription
File IDYesThe unique identifier of the file to share.
Email AddressNoThe person to share with. Leave empty to create a public link.
RoleNoThe access level, one of reader, commenter, writer, fileOrganizer, organizer, or owner. Defaults to reader.
Permission TypeNoThe kind of grantee, one of user, group, domain, or anyone. Defaults to user.
Send Notification EmailNoWhether to email the recipient about the share. Toggle, defaults to on.
Email MessageNoA custom message to include in the notification.

Google Drive File List

Lists files in Drive.

InputRequiredDescription
Folder IDNoThe folder to list files from. Leave empty for the root folder.
QueryNoA filter in Google Drive query syntax, such as name contains 'report'.
Max ResultsNoMaximum number of files to return, from 1 to 1000. Defaults to 100.
Include TrashedNoWhether to include trashed files. Toggle, defaults to off.

Google Drive File Delete

Deletes a file from Drive.

InputRequiredDescription
File IDYesThe unique identifier of the file to delete.

Folder

Google Drive Folder Create

Creates a new folder.

InputRequiredDescription
Folder NameYesThe name of the folder to create.
Parent Folder IDNoThe folder to place the new folder in. Leave empty for the root folder.

Example

An agent that files a generated report into Drive and shares it:

A Google Drive Folder Create action makes a folder named for the reporting period and returns its ID.

A Google Drive File Upload action sets File Name and File Content Base64 from the generated report, sets Content Type to application/pdf, and maps Parent Folder ID to the folder from the previous step.

A Google Drive File Share action maps File ID to the uploaded file, sets Email Address to the recipient, and sets Role to reader.

Troubleshooting

For issues common to every vendor, see the Actions overview.

Was this page helpful?

On this page