Google Drive
Procedures and concepts for the Google Drive integration.
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)
Go to Books → All Books.
Search for the name of the book and click on it.
Click on Install or Add Connection to add the book to your agent.
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.
Connect using Client Email, Token URI and Private Key
Gets the credentials from the service account keys.
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
item
The item (file or folder) to copy
google drive file reference or 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
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
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
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
Output Concepts
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
path
The path to the folder
text
Yes
(no default)
Output Concepts
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
Examples
Get a root folder
to get some (folder's items)
Lists items from a folder reference
Input Concepts
Output Concepts
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
item
The item (file or folder) to move
google drive file reference or 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
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
file
The file to upload
file
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
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.
id
The id of the file
text
file_name
The name of the file
text
Google drive folder reference
Contains all information required to identify a folder in Google Drive.
id
The id of the folder
text
folder_name
The name of the folder
text
Last updated
Was this helpful?

