googleGoogle Drive

Procedures and concepts for the Google Drive integration.

circle-info

The following documentation is for Google Drive v2.0.1 (BDK).

Overview

Google Drive offers cloud storage and file synchronization with seamless integration across Google Workspace. This integration enables automated file management, sharing workflows, and document organization processes. Streamline file collaboration and maintain synchronized access to important documents.

Prerequisites

1. Required Books

The following Book(s) need to be added to your agent so it can learn and understand the automation procedures defined within them:

  • Google Drive

How to Add the Book(s)

  1. Go to BooksAll Books.

  2. Search for the name of the book and click on it.

  3. Click on Install or Add Connection to add the book to your agent.

  4. If adding a connection, you'll be prompted for connectivity details.

Connectivity

This section outlines the available methods for connecting to the Book, along with the required configuration details for each.

This books supports the connectivity methods described in this section.In here you will find information about what information is required in order to employ each method.

Connect using Client Email, Token URI and Private Key

Gets the credentials from the service account keys.

Label
Description
Type

Client Email

The client email of the service account registered in the Google Cloud Console.

text

Token URI

The token URI of the Google Cloud Console.

text

Private Key

The private key of the service account registered in the Google Cloud Console.

sensitive

Procedures

to copy an item to a folder

Copy an item to a folder

Input Concepts

Concept
Description
Type
Required
Default Value

item

The item (file or folder) to copy

google drive file reference or google drive folder reference

Yes

(no default)

The folder to copy the item to

google drive folder reference

Yes

(no default)

conflict behavior

The behavior to use on conflict scenarios. It should be one of the following values: ('fail', 'replace', 'rename')

text

No

(no default)

Examples

Copy an item to a folder

Copy an item to a folder with a conflict behavior

to create a (folder) in another folder

Create a (folder) in another folder

Input Concepts

Concept
Description
Type
Required
Default Value

The folder to create the (folder) in

google drive folder reference

Yes

(no default)

folder name

The name of the (folder) to create

text

Yes

(no default)

conflict behavior

The behavior to use on conflict scenarios. It should be one of the following values: ('fail', 'replace', 'rename')

text

No

(no default)

Output Concepts

Concept
Description
Type

a folder reference to the created folder

google drive folder reference

Examples

Create a folder in Google Drive

Create a folder in Google Drive, with 'rename' as the conflict behavior

to delete an item

Delete an item (file or folder)

Input Concepts

Concept
Description
Type
Required
Default Value

item

The item (file or folder) to delete

google drive file reference or google drive folder reference

Yes

(no default)

Examples

Delete an item

to download a file

Download a file

Input Concepts

Concept
Description
Type
Required
Default Value

The file reference to the file to download

google drive file reference

Yes

(no default)

Output Concepts

Concept
Description
Type

answer

the file as an IO object

file

Examples

Download a file

to get a (folder) at a path

Gets a reference to a folder.

Google Drive allows for multiple folders with the same name in a parent folder. For now, as the blueprint interface returns only one reference, it is returning the first item on the returned list. In case there are more than one folder with the same name, an error will be raised. In the future, this may change to a list of FolderReferences.

Input Concepts

Concept
Description
Type
Required
Default Value

path

The path to the folder

text

Yes

(no default)

Output Concepts

Concept
Description
Type

a folder reference

google drive folder reference

Examples

Get a folder at the path 'The Folder/The Subfolder'

to get a (root folder)

Gets a reference to the root folder.

Output Concepts

Concept
Description
Type

a folder reference

google drive folder reference

Examples

Get a root folder

to get some (folder's items)

FILTER - CAPABLE

Lists items from a folder reference

Input Concepts

Concept
Description
Type
Required
Default Value

The folder reference from which to list the items

google drive folder reference

Yes

(no default)

Output Concepts

Concept
Description
Type

folder's items

a list of Items (file or folder) containing the items in the folder

google drive file reference or google drive folder reference

Examples

List items in a folder

to move an item to a folder

Move an item to a folder

Input Concepts

Concept
Description
Type
Required
Default Value

item

The item (file or folder) to move

google drive file reference or google drive folder reference

Yes

(no default)

The folder to move the item to

google drive folder reference

Yes

(no default)

conflict behavior

The behavior to use on conflict scenarios. It should be one of the following values: ('fail', 'replace', 'rename')

text

No

(no default)

Examples

Move an item to a folder

Move an item to a folder with a conflict behavior

to rename an item to a name

Rename an item (file or folder) to a given name

Input Concepts

Concept
Description
Type
Required
Default Value

item

The item (file or folder) to rename

google drive file reference or google drive folder reference

Yes

(no default)

name

The new name of the item

text

Yes

(no default)

conflict behavior

The behavior to use on conflict scenarios. It should be one of the following values: ('fail', 'replace', 'rename')

text

No

(no default)

Examples

Rename an item to a new name

Rename an item to a new name, with 'rename' as the conflict behavior

to upload a (file) to a folder

Upload a file to a folder

Input Concepts

Concept
Description
Type
Required
Default Value

file

The file to upload

file

Yes

(no default)

The folder to upload the file to

google drive folder reference

Yes

(no default)

file name

The name of the file to upload

text

Yes

(no default)

conflict behavior

The behavior to use on conflict scenarios. It should be one of the following values: ('fail', 'replace', 'rename')

text

No

(no default)

Output Concepts

Concept
Description
Type

a file reference to the uploaded file

google drive file reference

Examples

Upload a file to a folder

Upload a file to a folder with a conflict behavior

Concepts

Google drive file reference

Contains all information required to identify a file in Google Drive.

Field Name
Description
Type

id

The id of the file

text

file_name

The name of the file

text

The ids of the parent folders

list of text

Google drive folder reference

Contains all information required to identify a folder in Google Drive.

Field Name
Description
Type

id

The id of the folder

text

folder_name

The name of the folder

text

The ids of the parent folders

list of text

Last updated

Was this helpful?