Skip to main content

Google Drive

Find files, upload files produced by your workflow, download files for other blocks, convert Google Docs to PDF, create folders and share files. Shared drives work too.

1. Connect​

  1. In Blokkio, go to Apps and open Google Drive.
  2. Click Sign in under Sign in with Google and allow access.
  3. Test connection calls GET /drive/v3/about.

Blokkio asks for https://www.googleapis.com/auth/drive (all your Drive files, needed to search and download files Blokkio didn't create), with offline access.

Without one-click sign-in, use Bring your own OAuth app: the same steps as for Gmail, but enable the Google Drive API and add the drive scope. drive is a restricted scope: publishing the app beyond test users needs Google's verification.

IDs​

Drive identifies files and folders by ID. It's the long part of the URL: drive.google.com/drive/folders/<folder ID>, docs.google.com/document/d/<file ID>/edit. root is your My Drive.

Actions​

ActionWhat it does
Search filesA Drive query: name contains 'invoice' and mimeType = 'application/pdf' and trashed = false. Default: everything not in the trash.
List folderFiles and folders in a folder (default My Drive), folders first.
Get file detailsName, type, size, dates, links and owners.
Download fileThe file's content as a file for other blocks, named as in Drive. Not for Google Docs/Sheets/Slides: use Export.
Export Google Doc, Sheet or SlidesConverts to PDF, Word, Excel, PowerPoint, CSV, text or HTML (Google's limit: 10 MB).
Upload fileUploads a file from another block ({{ $nodes.Report.output.file }}), up to 250 MB. Optional name (default: the file's name), folder, description, and conversion to Google Docs/Sheets/Slides.
Create folderIn My Drive or a parent folder.
Share file or folderWith a person, a group, a domain or anyone with the link, as viewer, commenter or editor; optionally with an email.
Move to trashDrive deletes it after 30 days.

Large uploads and downloads are streamed, never held in memory. Uploads and downloads of up to 250 MB work.

Triggers​

New file in folder starts a run for each file or folder added to a folder (default My Drive).

Troubleshooting​

MessageWhat to do
HTTP 404 … File not foundWrong ID, or the connected account can't see the file.
HTTP 403 … Only files with binary content can be downloadedIt's a Google Doc/Sheet/Slides file: use Export.
HTTP 403 … exportSizeLimitExceededThe document is over 10 MB when exported.
Choose a file to uploadThe File input is empty or isn't a file from another block.