Google Drive
Upload files, create folders, and manage content in Google Drive.
On this page
- Connect
- Call it from a workflow
- Actions (16)
- list-files
- read-file
- search-folder
- create_new_gdrive_file
- create_new_gdrive_folder
- custom_api_call
- delete_gdrive_file
- delete_permissions
- duplicate_file
- get-file-or-folder-by-id
- google-drive-move-file
- save_file_as_pdf
- set_public_access
- trash_gdrive_file
- update_permissions
- upload_gdrive_file
- Details
Connect
Auth type: OAuth (oauth2). Click Connect and approve access on the provider's page. Appbricx runs the OAuth flow (signed single-use state, PKCE where the provider supports it), stores the tokens encrypted and refreshes them before they expire.
Scopes requested: https://www.googleapis.com/auth/drive
OAuth needs an OAuth app: the platform's when the operator configured one, or your own (admin panel, Integrations, Configure). You can also bring your own credentials.
- In the editor: Backend panel, Integrations tab, then Connect. This connects it for the project.
- For every project in a workspace: Workspace settings, Integrations.
- Owners and admins choose which integrations members may connect in the admin panel (Integrations tab), and can attach their own OAuth app there.
Call it from a workflow
Pass the action name and its input. The call resolves with { success, output, error? }; a missing connection resolves with success false and the reason. See ctx.integrations.invoke and ctx.integrations.call.
// .workflow.js (native ctx)
export async function run(ctx) {
const res = await ctx.integrations.invoke("google_drive", "list-files", {
"folderId": "<folder id>"
});
if (!res.success) throw new Error(res.error);
ctx.log.info("Google Drive answered", { output: res.output });
}// defineWorkflow module (@app/sdk ctx)
import { defineWorkflow } from "@app/sdk";
export default defineWorkflow({
id: "google-drive-list-files",
name: "Google Drive: List files",
description: "Calls Google Drive when a row is created.",
trigger: { type: "entity_event", entity: "tickets", event: "created" },
async run(ctx, event) {
const res = await ctx.integrations.call("google_drive", {
"action": "list-files",
"folderId": "<folder id>"
}) as { success: boolean; error?: string };
if (!res.success) throw new Error(res.error);
},
});curl -X POST "$APP_ORIGIN/__appbricx/connector-proxy/google_drive/list-files" \
-H "Authorization: Bearer $APP_KEY" \
-H "content-type: application/json" \
-d '{"props":{"folderId":"<folder id>"}}'Actions
list-filesin catalog
List files. List files from a Google Drive folder
Also accepted as list_files.
| Input | Type | Description |
|---|---|---|
folderIdrequired | text | Folder ID coming from | New Folder -> id | (or any other source) |
include_team_drivesoptional | boolean | Determines if folders from Team Drives should be included in the results. |
includeTrashedoptional | boolean | Include new files that have been trashed. |
depthLeveloptional | number | How many levels deep to search for files. 1 = current folder only, 2 = current + next level, etc. |
downloadFilesoptional | boolean | Download all file contents in a list |
read-filein catalog
Read File Content. Read a selected file from google drive file
| Input | Type | Description |
|---|---|---|
fileIdrequired | text | File ID coming from | New File -> id | |
fileNameoptional | text | Destination File name |
search-folderin catalog
Search. Search a Google Drive folder for files/sub-folders
| Input | Type | Description |
|---|---|---|
queryTermrequired | one of "name" | "fullText" | "mimeType" | The Query term or field of file/folder to search upon. |
operatorrequired | one of "contains" | "=" | The operator to create criteria. |
queryrequired | text | Value of the field of file/folder to search for. |
typeoptional | one of "all" | "file" | "folder" | (Optional) Choose between files and folders. |
parentFolderoptional | id (picked from your account) | Parent Folder |
include_team_drivesoptional | boolean | Determines if folders from Team Drives should be included in the results. |
create_new_gdrive_file
Create new file. Create a new text file in your Google Drive from text
| Input | Type | Description |
|---|---|---|
fileNamerequired | text | The name of the new text file |
textrequired | long text | The text content to add to file |
fileTyperequired | one of "plain/text" | "text/csv" | "text/xml" | Select file type |
parentFolderoptional | id (picked from your account) | Parent Folder |
include_team_drivesoptional | boolean | Determines if folders from Team Drives should be included in the results. |
create_new_gdrive_folder
Create new folder. Create a new empty folder in your Google Drive
| Input | Type | Description |
|---|---|---|
folderNamerequired | text | The name of the new folder |
parentFolderoptional | id (picked from your account) | Parent Folder |
include_team_drivesoptional | boolean | Determines if folders from Team Drives should be included in the results. |
custom_api_call
Custom API Call. Make a custom API call to a specific endpoint
| Input | Type | Description |
|---|---|---|
urlrequired | object (depends on other props) | url |
methodrequired | one of "GET" | "POST" | "PATCH" | "PUT" | "DELETE" | "HEAD" | Method |
headersrequired | object | Authorization headers are injected automatically from your connection. |
queryParamsrequired | object | Query Parameters |
body_typeoptional | one of "none" | "json" | "form_data" | "raw" | Body Type |
bodyoptional | object (depends on other props) | Body |
response_is_binaryoptional | boolean | Enable for files like PDFs, images, etc. |
failsafeoptional | boolean | No Error on Failure |
timeoutoptional | number | Timeout (in seconds) |
followRedirectsoptional | boolean | Follow redirects |
delete_gdrive_file
Delete file. Delete permanently a file from your Google Drive
| Input | Type | Description |
|---|---|---|
fileIdrequired | text | The ID of the file to delete |
include_team_drivesoptional | boolean | Determines if folders from Team Drives should be included in the results. |
delete_permissions
Delete permissions. Removes a role from an user for a file or folder
| Input | Type | Description |
|---|---|---|
fileIdrequired | text | The ID of the file or folder to update permissions for |
user_emailrequired | text | The email address of the user to update permissions for |
permission_namerequired | one of "organizer" | "fileOrganizer" | "writer" | "commenter" | "reader" | The role to remove from user. |
duplicate_file
Duplicate File. Duplicate a file from Google Drive. Returns the new file ID.
| Input | Type | Description |
|---|---|---|
fileIdrequired | text | The ID of the file to duplicate |
namerequired | text | The name of the new file |
folderIdrequired | text | The ID of the folder where the file will be duplicated |
mimeTypeoptional | one of "application/vnd.google-apps.spreadsheet" | "application/vnd.google-apps.document" | If left unselected the file will be duplicated as it is |
include_team_drivesoptional | boolean | Determines if folders from Team Drives should be included in the results. |
get-file-or-folder-by-id
Get File Information. Get a file folder for files/sub-folders
| Input | Type | Description |
|---|---|---|
idrequired | text | The Id of the file/folder to search for. |
include_team_drivesoptional | boolean | Determines if folders from Team Drives should be included in the results. |
google-drive-move-file
Move File. Moves a file from one folder to another.
| Input | Type | Description |
|---|---|---|
fileIdrequired | text | You can use **Search Folder/File** action to retrieve ID. |
include_team_drivesoptional | boolean | Determines if folders from Team Drives should be included in the results. |
folderIdoptional | id (picked from your account) | Parent Folder |
save_file_as_pdf
Save Document as PDF. Save a document as PDF in a Google Drive folder
| Input | Type | Description |
|---|---|---|
documentIdrequired | text | The ID of the document to export |
folderIdrequired | text | The ID of the folder where the file will be exported |
namerequired | text | The name of the new file (do not include the extension) |
include_team_drivesoptional | boolean | Determines if folders from Team Drives should be included in the results. |
set_public_access
Set public access. Set public access for a file or folder
| Input | Type | Description |
|---|---|---|
fileIdrequired | text | The ID of the file or folder to update permissions for |
rolerequired | one of "reader" | "commenter" | "writer" | The role to assign for public access |
trash_gdrive_file
Trash file. Move a file to the trash in your Google Drive
| Input | Type | Description |
|---|---|---|
fileIdrequired | text | The ID of the file to trash |
include_team_drivesoptional | boolean | Determines if folders from Team Drives should be included in the results. |
update_permissions
Update permissions. Update permissions for a file or folder
| Input | Type | Description |
|---|---|---|
fileIdrequired | text | The ID of the file or folder to update permissions for |
user_emailrequired | text | The email address of the user to update permissions for |
permission_namerequired | one of "organizer" | "fileOrganizer" | "writer" | "commenter" | "reader" | The role to grant to user. See more at: https://developers.google.com/drive/api/guides/ref-roles |
include_team_drivesoptional | boolean | Determines if folders from Team Drives should be included in the results. |
send_invitation_emailrequired | boolean | Send an email to the user to notify them of the new permissions |
upload_gdrive_file
Upload file. Upload a file in your Google Drive
| Input | Type | Description |
|---|---|---|
fileNamerequired | text | The name of the file |
filerequired | file | The file URL or base64 to upload |
parentFolderoptional | id (picked from your account) | Parent Folder |
include_team_drivesoptional | boolean | Determines if folders from Team Drives should be included in the results. |
Details
- Id
google_drive- Category
- Productivity
- Tags
- google, drive, files, storage, cloud
- Package
@activepieces/piece-google-drive@0.7.1- Tier
- Built in