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
- In Blokkio, go to Apps and open Google Drive.
- Click Sign in under Sign in with Google and allow access.
- 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
| Action | What it does |
|---|---|
| Search files | A Drive query: name contains 'invoice' and mimeType = 'application/pdf' and trashed = false. Default: everything not in the trash. |
| List folder | Files and folders in a folder (default My Drive), folders first. |
| Get file details | Name, type, size, dates, links and owners. |
| Download file | The 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 Slides | Converts to PDF, Word, Excel, PowerPoint, CSV, text or HTML (Google's limit: 10 MB). |
| Upload file | Uploads 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 folder | In My Drive or a parent folder. |
| Share file or folder | With a person, a group, a domain or anyone with the link, as viewer, commenter or editor; optionally with an email. |
| Move to trash | Drive 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
| Message | What to do |
|---|---|
HTTP 404 … File not found | Wrong ID, or the connected account can't see the file. |
HTTP 403 … Only files with binary content can be downloaded | It's a Google Doc/Sheet/Slides file: use Export. |
HTTP 403 … exportSizeLimitExceeded | The document is over 10 MB when exported. |
Choose a file to upload | The File input is empty or isn't a file from another block. |