Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Google Drive

connector.google_drive · connector.google_drive_trigger · storage, productivity

Upload, download, search, share and organize files, folders and shared drives in Google Drive.

Vendor API documentation: https://developers.google.com/drive/api/reference/rest/v3

Authentication

MethodCredential kindAuth kindFieldsTest request
Google account (OAuth2)google_drive/oauth2oauth2_auth_codeclient_id, client_secret (secret), scopesyes
Service accountgoogle_drive/service_accountjwt_service_accountclient_email, private_key (secret), subject, scopesyes

Actions

Node type connector.google_drive. Choose a resource and an operation; each operation has its own parameters.

File

OperationIDEffectPaginatedCassette tests
Upload a filefile.uploadwrites2
Create a file from textfile.create_from_textwrites1
Download a filefile.downloadreads2
Get file detailsfile.getreads3
Search files and foldersfile.listreadsyes2
Update file detailsfile.updatewrites1
Replace file contentfile.update_contentwrites1
Copy a filefile.copywrites1
Move a filefile.movewrites1
Delete a filefile.deletewrites2
Share a filefile.sharewrites1

Upload a file

Operation file.upload. Uploads binary data from the input item. Files over 5 MB use a resumable session.

NameTypeDefaultRequiredShown whenDescription
binary_propertybinary_property"data"Name of the binary property on the input item.
file_namestringName in Drive (default the binary’s file name).
folderresource_locatorParent folder. Folder to put the file in (default: My Drive root). For a shared drive root use the drive ID. Values from lookup folders.
convert_tooptions""Convert the upload to a Google Workspace format. One of ``, application/vnd.google-apps.document, application/vnd.google-apps.spreadsheet, application/vnd.google-apps.presentation.
descriptionstring
mime_typestringMIME type. Content type to declare (default the binary’s MIME type).

Create a file from text

Operation file.create_from_text. Creates a file whose content is the given text, optionally converted to a Google Doc.

NameTypeDefaultRequiredShown whenDescription
file_namestringyes
contentstringyes
folderresource_locatorParent folder. Folder to put the file in (default: My Drive root). For a shared drive root use the drive ID. Values from lookup folders.
convert_to_google_docbooleanfalseConvert to Google Docs.
mime_typestring"text/plain"Text MIME type.
descriptionstring

Download a file

Operation file.download. Downloads file content into a binary property. Google Workspace documents are exported to the format chosen below.

NameTypeDefaultRequiredShown whenDescription
fileresource_locatoryesPick a file, paste its URL or enter its ID. Values from lookup files.
binary_propertystring"data"Put into binary property.
file_namestringOverride the file name of the binary.
docs_formatoptions"application/vnd.openxmlformats-officedocument.wordprocessingml.document"Google Docs as. One of application/vnd.openxmlformats-officedocument.wordprocessingml.document, application/pdf, text/plain, text/html, application/rtf, application/vnd.oasis.opendocument.text, text/markdown.
sheets_formatoptions"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"Google Sheets as. One of application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, text/csv, application/pdf, application/vnd.oasis.opendocument.spreadsheet.
slides_formatoptions"application/vnd.openxmlformats-officedocument.presentationml.presentation"Google Slides as. One of application/vnd.openxmlformats-officedocument.presentationml.presentation, application/pdf, text/plain.
drawings_formatoptions"image/png"Google Drawings as. One of image/png, image/jpeg, image/svg+xml, application/pdf.

Get file details

Operation file.get.

NameTypeDefaultRequiredShown whenDescription
fileresource_locatoryesPick a file, paste its URL or enter its ID. Values from lookup files.
fieldsstringComma-separated file fields to return (default: the common ones; * for all).

Search files and folders

Operation file.list. Lists files matching the filters below, newest first.

NameTypeDefaultRequiredShown whenDescription
name_containsstring
folderresource_locatorIn folder. Only direct children of this folder. Values from lookup folders.
mime_typeoptions""Type. One of ``, application/vnd.google-apps.folder, application/vnd.google-apps.document, application/vnd.google-apps.spreadsheet, application/vnd.google-apps.presentation, application/vnd.google-apps.form, application/pdf, image/jpeg, image/png, text/plain.
querystringExtra query. Additional Drive search clauses, combined with the filters using and.
include_trashedbooleanfalseInclude trashed items.
driveresource_locatorShared drive. Search only this shared drive (default: everything the account can see). Values from lookup drives.
order_bystring"modifiedTime desc"
fieldsstringComma-separated file fields to return (default: the common ones; * for all).
return_allbooleanfalse
limitnumber50return_all = false

Update file details

Operation file.update. Renames a file or changes its description, star or content restrictions.

NameTypeDefaultRequiredShown whenDescription
fileresource_locatoryesPick a file, paste its URL or enter its ID. Values from lookup files.
namestringNew name.
descriptionstring
starredboolean
writers_can_sharebooleanEditors can share.
copy_requires_writer_permissionbooleanDisable download and copy for viewers.
keep_revision_foreverbooleanfalseKeep this revision forever.

Replace file content

Operation file.update_content. Uploads new content for an existing file as a new revision (resumable, any size).

NameTypeDefaultRequiredShown whenDescription
fileresource_locatoryesPick a file, paste its URL or enter its ID. Values from lookup files.
binary_propertybinary_property"data"Name of the binary property on the input item.
file_namestringNew name.
keep_revision_foreverbooleanfalseKeep this revision forever.

Copy a file

Operation file.copy.

NameTypeDefaultRequiredShown whenDescription
fileresource_locatoryesPick a file, paste its URL or enter its ID. Values from lookup files.
namestringName of the copy. Default: Drive’s ‘Copy of’ name.
folderresource_locatorParent folder. Default: the original’s folder. Values from lookup folders.
descriptionstring

Move a file

Operation file.move. Moves a file (or folder) into another folder, removing it from its current folders.

NameTypeDefaultRequiredShown whenDescription
fileresource_locatoryesPick a file, paste its URL or enter its ID. Values from lookup files.
folderresource_locatoryesDestination folder. Values from lookup folders.

Delete a file

Operation file.delete. Moves the file to the trash, or deletes it permanently.

NameTypeDefaultRequiredShown whenDescription
fileresource_locatoryesPick a file, paste its URL or enter its ID. Values from lookup files.
permanentlybooleanfalseDelete permanently. Skip the trash (cannot be undone).

Share a file

Operation file.share. Grants a user, group, domain or anyone with the link access to the file.

NameTypeDefaultRequiredShown whenDescription
fileresource_locatoryesPick a file, paste its URL or enter its ID. Values from lookup files.
roleoptions"reader"One of reader, commenter, writer, fileOrganizer, organizer, owner.
typeoptions"user"Share with. One of user, group, domain, anyone.
emailstringtype = user, groupEmail address.
domainstringtype = domain
allow_file_discoverybooleanfalsetype = domain, anyoneFindable in search.
send_notificationbooleantruetype = user, groupSend notification email.
email_messagestringtype = user, groupMessage.
expiration_timedatetimeExpires at. Access ends at this time (RFC 3339).

Folder

OperationIDEffectPaginatedCassette tests
Create a folderfolder.createwrites1
Delete a folderfolder.deletewrites1
Share a folderfolder.sharewrites1

Create a folder

Operation folder.create.

NameTypeDefaultRequiredShown whenDescription
namestringyes
folderresource_locatorParent folder. Default: My Drive root. Values from lookup folders.
colorstringFolder color as a hex RGB value.
descriptionstring

Delete a folder

Operation folder.delete. Moves the folder and its contents to the trash, or deletes it permanently.

NameTypeDefaultRequiredShown whenDescription
fileresource_locatoryesFolder. Pick a folder, paste its URL or enter its ID. Values from lookup folders.
permanentlybooleanfalseDelete permanently. Skip the trash (cannot be undone).

Share a folder

Operation folder.share.

NameTypeDefaultRequiredShown whenDescription
fileresource_locatoryesFolder. Pick a folder, paste its URL or enter its ID. Values from lookup folders.
roleoptions"reader"One of reader, commenter, writer, fileOrganizer, organizer, owner.
typeoptions"user"Share with. One of user, group, domain, anyone.
emailstringtype = user, groupEmail address.
domainstringtype = domain
allow_file_discoverybooleanfalsetype = domain, anyoneFindable in search.
send_notificationbooleantruetype = user, groupSend notification email.
email_messagestringtype = user, groupMessage.
expiration_timedatetimeExpires at. Access ends at this time (RFC 3339).

Shared drive

OperationIDEffectPaginatedCassette tests
Create a shared drivedrive.createwrites1
Get a shared drivedrive.getreads1
List shared drivesdrive.listreadsyes2
Update a shared drivedrive.updatewrites1
Delete a shared drivedrive.deletewrites1

Create a shared drive

Operation drive.create.

NameTypeDefaultRequiredShown whenDescription
namestringyes
hiddenbooleanfalse

Get a shared drive

Operation drive.get.

NameTypeDefaultRequiredShown whenDescription
driveresource_locatoryesShared drive. Pick a shared drive, paste its URL or enter its ID. Values from lookup drives.

List shared drives

Operation drive.list.

NameTypeDefaultRequiredShown whenDescription
querystringDrive search query for shared drives.
return_allbooleanfalse
limitnumber50return_all = false

Update a shared drive

Operation drive.update.

NameTypeDefaultRequiredShown whenDescription
driveresource_locatoryesShared drive. Pick a shared drive, paste its URL or enter its ID. Values from lookup drives.
namestringNew name.
colorstringTheme color as a hex RGB value.
restrictionscollection
restrictions.adminManagedRestrictionsbooleanOnly managers change restrictions.
restrictions.copyRequiresWriterPermissionbooleanViewers cannot download or copy.
restrictions.domainUsersOnlybooleanOnly domain users have access.
restrictions.driveMembersOnlybooleanOnly members have access.

Delete a shared drive

Operation drive.delete. The shared drive must be empty.

NameTypeDefaultRequiredShown whenDescription
driveresource_locatoryesShared drive. Pick a shared drive, paste its URL or enter its ID. Values from lookup drives.

Lookups

Lookups fill dropdowns and resource pickers in the editor from the vendor API.

LookupDepends onSearchDescription
foldersclient-side
filesclient-side{{ item.mimeType }}
drivesclient-side

Triggers

Node type connector.google_drive_trigger.

TriggerIDKindDeduplication keySignatureWebhook registrationCassette tests
File createdfile_createdpoll{{ item.id }}0
File updatedfile_updatedpoll{{ item.id ~ '@' ~ item.modifiedTime }}0
Folder createdfolder_createdpoll{{ item.id }}0

Trigger: File created

Emits files created since the previous poll, optionally only inside one folder or of one type.

NameTypeDefaultRequiredShown whenDescription
folderresource_locatorIn folder. Watch only direct children of this folder (default: the whole Drive). Values from lookup folders.
mime_typestringFile type. Only files of this MIME type.
driveresource_locatorShared drive. Watch only this shared drive. Values from lookup drives.

Trigger: File updated

Emits files whose content or details changed since the previous poll (new files included).

NameTypeDefaultRequiredShown whenDescription
folderresource_locatorIn folder. Watch only direct children of this folder (default: the whole Drive). Values from lookup folders.
mime_typestringFile type. Only files of this MIME type.
driveresource_locatorShared drive. Watch only this shared drive. Values from lookup drives.

Trigger: Folder created

Emits folders created since the previous poll.

NameTypeDefaultRequiredShown whenDescription
folderresource_locatorIn folder. Watch only direct children of this folder (default: the whole Drive). Values from lookup folders.
driveresource_locatorShared drive. Watch only this shared drive. Values from lookup drives.

Import

Exported workflows that use these node types import to this node. Unverified ranges import with a parameter warning until parity fixtures confirm them; see Migrating.

Source typeVersion rangeStatusFixtures
n8n-nodes-base.googleDrive>=3 <4unverified
n8n-nodes-base.googleDriveTrigger>=1 <2unverified

Provenance

Written from the vendor’s documentation: