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
| Method | Credential kind | Auth kind | Fields | Test request |
|---|---|---|---|---|
| Google account (OAuth2) | google_drive/oauth2 | oauth2_auth_code | client_id, client_secret (secret), scopes | yes |
| Service account | google_drive/service_account | jwt_service_account | client_email, private_key (secret), subject, scopes | yes |
Actions
Node type connector.google_drive. Choose a resource and an operation; each operation has its own parameters.
File
| Operation | ID | Effect | Paginated | Cassette tests |
|---|---|---|---|---|
| Upload a file | file.upload | writes | 2 | |
| Create a file from text | file.create_from_text | writes | 1 | |
| Download a file | file.download | reads | 2 | |
| Get file details | file.get | reads | 3 | |
| Search files and folders | file.list | reads | yes | 2 |
| Update file details | file.update | writes | 1 | |
| Replace file content | file.update_content | writes | 1 | |
| Copy a file | file.copy | writes | 1 | |
| Move a file | file.move | writes | 1 | |
| Delete a file | file.delete | writes | 2 | |
| Share a file | file.share | writes | 1 |
Upload a file
Operation file.upload. Uploads binary data from the input item. Files over 5 MB use a resumable session.
| Name | Type | Default | Required | Shown when | Description |
|---|---|---|---|---|---|
binary_property | binary_property | "data" | Name of the binary property on the input item. | ||
file_name | string | Name in Drive (default the binary’s file name). | |||
folder | resource_locator | Parent 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 | options | "" | 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. | ||
description | string | ||||
mime_type | string | MIME 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.
| Name | Type | Default | Required | Shown when | Description |
|---|---|---|---|---|---|
file_name | string | yes | |||
content | string | yes | |||
folder | resource_locator | Parent 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_doc | boolean | false | Convert to Google Docs. | ||
mime_type | string | "text/plain" | Text MIME type. | ||
description | string |
Download a file
Operation file.download. Downloads file content into a binary property. Google Workspace documents are exported to the format chosen below.
| Name | Type | Default | Required | Shown when | Description |
|---|---|---|---|---|---|
file | resource_locator | yes | Pick a file, paste its URL or enter its ID. Values from lookup files. | ||
binary_property | string | "data" | Put into binary property. | ||
file_name | string | Override the file name of the binary. | |||
docs_format | options | "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_format | options | "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_format | options | "application/vnd.openxmlformats-officedocument.presentationml.presentation" | Google Slides as. One of application/vnd.openxmlformats-officedocument.presentationml.presentation, application/pdf, text/plain. | ||
drawings_format | options | "image/png" | Google Drawings as. One of image/png, image/jpeg, image/svg+xml, application/pdf. |
Get file details
Operation file.get.
| Name | Type | Default | Required | Shown when | Description |
|---|---|---|---|---|---|
file | resource_locator | yes | Pick a file, paste its URL or enter its ID. Values from lookup files. | ||
fields | string | Comma-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.
| Name | Type | Default | Required | Shown when | Description |
|---|---|---|---|---|---|
name_contains | string | ||||
folder | resource_locator | In folder. Only direct children of this folder. Values from lookup folders. | |||
mime_type | options | "" | 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. | ||
query | string | Extra query. Additional Drive search clauses, combined with the filters using and. | |||
include_trashed | boolean | false | Include trashed items. | ||
drive | resource_locator | Shared drive. Search only this shared drive (default: everything the account can see). Values from lookup drives. | |||
order_by | string | "modifiedTime desc" | |||
fields | string | Comma-separated file fields to return (default: the common ones; * for all). | |||
return_all | boolean | false | |||
limit | number | 50 | return_all = false |
Update file details
Operation file.update. Renames a file or changes its description, star or content restrictions.
| Name | Type | Default | Required | Shown when | Description |
|---|---|---|---|---|---|
file | resource_locator | yes | Pick a file, paste its URL or enter its ID. Values from lookup files. | ||
name | string | New name. | |||
description | string | ||||
starred | boolean | ||||
writers_can_share | boolean | Editors can share. | |||
copy_requires_writer_permission | boolean | Disable download and copy for viewers. | |||
keep_revision_forever | boolean | false | Keep this revision forever. |
Replace file content
Operation file.update_content. Uploads new content for an existing file as a new revision (resumable, any size).
| Name | Type | Default | Required | Shown when | Description |
|---|---|---|---|---|---|
file | resource_locator | yes | Pick a file, paste its URL or enter its ID. Values from lookup files. | ||
binary_property | binary_property | "data" | Name of the binary property on the input item. | ||
file_name | string | New name. | |||
keep_revision_forever | boolean | false | Keep this revision forever. |
Copy a file
Operation file.copy.
| Name | Type | Default | Required | Shown when | Description |
|---|---|---|---|---|---|
file | resource_locator | yes | Pick a file, paste its URL or enter its ID. Values from lookup files. | ||
name | string | Name of the copy. Default: Drive’s ‘Copy of’ name. | |||
folder | resource_locator | Parent folder. Default: the original’s folder. Values from lookup folders. | |||
description | string |
Move a file
Operation file.move. Moves a file (or folder) into another folder, removing it from its current folders.
| Name | Type | Default | Required | Shown when | Description |
|---|---|---|---|---|---|
file | resource_locator | yes | Pick a file, paste its URL or enter its ID. Values from lookup files. | ||
folder | resource_locator | yes | Destination folder. Values from lookup folders. |
Delete a file
Operation file.delete. Moves the file to the trash, or deletes it permanently.
| Name | Type | Default | Required | Shown when | Description |
|---|---|---|---|---|---|
file | resource_locator | yes | Pick a file, paste its URL or enter its ID. Values from lookup files. | ||
permanently | boolean | false | Delete 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.
| Name | Type | Default | Required | Shown when | Description |
|---|---|---|---|---|---|
file | resource_locator | yes | Pick a file, paste its URL or enter its ID. Values from lookup files. | ||
role | options | "reader" | One of reader, commenter, writer, fileOrganizer, organizer, owner. | ||
type | options | "user" | Share with. One of user, group, domain, anyone. | ||
email | string | type = user, group | Email address. | ||
domain | string | type = domain | |||
allow_file_discovery | boolean | false | type = domain, anyone | Findable in search. | |
send_notification | boolean | true | type = user, group | Send notification email. | |
email_message | string | type = user, group | Message. | ||
expiration_time | datetime | Expires at. Access ends at this time (RFC 3339). |
Folder
| Operation | ID | Effect | Paginated | Cassette tests |
|---|---|---|---|---|
| Create a folder | folder.create | writes | 1 | |
| Delete a folder | folder.delete | writes | 1 | |
| Share a folder | folder.share | writes | 1 |
Create a folder
Operation folder.create.
| Name | Type | Default | Required | Shown when | Description |
|---|---|---|---|---|---|
name | string | yes | |||
folder | resource_locator | Parent folder. Default: My Drive root. Values from lookup folders. | |||
color | string | Folder color as a hex RGB value. | |||
description | string |
Delete a folder
Operation folder.delete. Moves the folder and its contents to the trash, or deletes it permanently.
| Name | Type | Default | Required | Shown when | Description |
|---|---|---|---|---|---|
file | resource_locator | yes | Folder. Pick a folder, paste its URL or enter its ID. Values from lookup folders. | ||
permanently | boolean | false | Delete permanently. Skip the trash (cannot be undone). |
Share a folder
Operation folder.share.
| Name | Type | Default | Required | Shown when | Description |
|---|---|---|---|---|---|
file | resource_locator | yes | Folder. Pick a folder, paste its URL or enter its ID. Values from lookup folders. | ||
role | options | "reader" | One of reader, commenter, writer, fileOrganizer, organizer, owner. | ||
type | options | "user" | Share with. One of user, group, domain, anyone. | ||
email | string | type = user, group | Email address. | ||
domain | string | type = domain | |||
allow_file_discovery | boolean | false | type = domain, anyone | Findable in search. | |
send_notification | boolean | true | type = user, group | Send notification email. | |
email_message | string | type = user, group | Message. | ||
expiration_time | datetime | Expires at. Access ends at this time (RFC 3339). |
Shared drive
| Operation | ID | Effect | Paginated | Cassette tests |
|---|---|---|---|---|
| Create a shared drive | drive.create | writes | 1 | |
| Get a shared drive | drive.get | reads | 1 | |
| List shared drives | drive.list | reads | yes | 2 |
| Update a shared drive | drive.update | writes | 1 | |
| Delete a shared drive | drive.delete | writes | 1 |
Create a shared drive
Operation drive.create.
| Name | Type | Default | Required | Shown when | Description |
|---|---|---|---|---|---|
name | string | yes | |||
hidden | boolean | false |
Get a shared drive
Operation drive.get.
| Name | Type | Default | Required | Shown when | Description |
|---|---|---|---|---|---|
drive | resource_locator | yes | Shared drive. Pick a shared drive, paste its URL or enter its ID. Values from lookup drives. |
List shared drives
Operation drive.list.
| Name | Type | Default | Required | Shown when | Description |
|---|---|---|---|---|---|
query | string | Drive search query for shared drives. | |||
return_all | boolean | false | |||
limit | number | 50 | return_all = false |
Update a shared drive
Operation drive.update.
| Name | Type | Default | Required | Shown when | Description |
|---|---|---|---|---|---|
drive | resource_locator | yes | Shared drive. Pick a shared drive, paste its URL or enter its ID. Values from lookup drives. | ||
name | string | New name. | |||
color | string | Theme color as a hex RGB value. | |||
restrictions | collection | ||||
restrictions.adminManagedRestrictions | boolean | Only managers change restrictions. | |||
restrictions.copyRequiresWriterPermission | boolean | Viewers cannot download or copy. | |||
restrictions.domainUsersOnly | boolean | Only domain users have access. | |||
restrictions.driveMembersOnly | boolean | Only members have access. |
Delete a shared drive
Operation drive.delete. The shared drive must be empty.
| Name | Type | Default | Required | Shown when | Description |
|---|---|---|---|---|---|
drive | resource_locator | yes | Shared 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.
| Lookup | Depends on | Search | Description |
|---|---|---|---|
folders | client-side | ||
files | client-side | {{ item.mimeType }} | |
drives | client-side |
Triggers
Node type connector.google_drive_trigger.
| Trigger | ID | Kind | Deduplication key | Signature | Webhook registration | Cassette tests |
|---|---|---|---|---|---|---|
| File created | file_created | poll | {{ item.id }} | 0 | ||
| File updated | file_updated | poll | {{ item.id ~ '@' ~ item.modifiedTime }} | 0 | ||
| Folder created | folder_created | poll | {{ item.id }} | 0 |
Trigger: File created
Emits files created since the previous poll, optionally only inside one folder or of one type.
| Name | Type | Default | Required | Shown when | Description |
|---|---|---|---|---|---|
folder | resource_locator | In folder. Watch only direct children of this folder (default: the whole Drive). Values from lookup folders. | |||
mime_type | string | File type. Only files of this MIME type. | |||
drive | resource_locator | Shared 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).
| Name | Type | Default | Required | Shown when | Description |
|---|---|---|---|---|---|
folder | resource_locator | In folder. Watch only direct children of this folder (default: the whole Drive). Values from lookup folders. | |||
mime_type | string | File type. Only files of this MIME type. | |||
drive | resource_locator | Shared drive. Watch only this shared drive. Values from lookup drives. |
Trigger: Folder created
Emits folders created since the previous poll.
| Name | Type | Default | Required | Shown when | Description |
|---|---|---|---|---|---|
folder | resource_locator | In folder. Watch only direct children of this folder (default: the whole Drive). Values from lookup folders. | |||
drive | resource_locator | Shared 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 type | Version range | Status | Fixtures |
|---|---|---|---|
n8n-nodes-base.googleDrive | >=3 <4 | unverified | |
n8n-nodes-base.googleDriveTrigger | >=1 <2 | unverified |
Provenance
Written from the vendor’s documentation:
- https://developers.google.com/drive/api/reference/rest/v3
- https://developers.google.com/drive/api/reference/rest/v3/files
- https://developers.google.com/drive/api/reference/rest/v3/files/create
- https://developers.google.com/drive/api/reference/rest/v3/files/get
- https://developers.google.com/drive/api/reference/rest/v3/files/list
- https://developers.google.com/drive/api/reference/rest/v3/files/update
- https://developers.google.com/drive/api/reference/rest/v3/files/copy
- https://developers.google.com/drive/api/reference/rest/v3/files/delete
- https://developers.google.com/drive/api/reference/rest/v3/files/export
- https://developers.google.com/drive/api/reference/rest/v3/permissions/create
- https://developers.google.com/drive/api/reference/rest/v3/drives
- https://developers.google.com/drive/api/guides/manage-uploads
- https://developers.google.com/drive/api/guides/manage-downloads
- https://developers.google.com/drive/api/guides/ref-export-formats
- https://developers.google.com/drive/api/guides/search-files
- https://developers.google.com/drive/api/guides/mime-types
- https://developers.google.com/drive/api/guides/handle-errors
- https://developers.google.com/drive/api/guides/api-specific-auth
- https://developers.google.com/identity/protocols/oauth2/web-server
- https://developers.google.com/identity/protocols/oauth2/service-account