Google Drive Action

The Drive action moves files in and out of Google Drive as one step of a flow: upload what a webhook received, list a folder and hand each file to the next node, export a Google Doc as PDF, share, move, rename. This page follows the node's screen from top to bottom — Google account, Mode, Default folder, Operation, Run Test, Output — so you can keep it open while you configure one.

✦Files move as file references: a downloaded file becomes _file in the output, and the next node (File Transform, AI Node, Vector Store, Email) reads it from there. Nothing is loaded into memory, so large files are fine.

1. Google account

Pick the Google credential the node will act as. Connect one under Settings → Credentials → Google Drive, or from this card. Google asks what the app may touch, and you pick one of three levels when connecting — the card shows the one the credential has (the small drive chip):

  • File-only — the app sees only files it created or that you picked in a Google picker. Enough for uploading and for working on those files. Listing your Drive returns nothing else.
  • Read-only — list, search, get and download any file you can see. No changes.
  • Full — everything: move, delete, share, rename on any file you have access to.

If an operation needs more than the credential has, the node tells you when you run it (see Troubleshooting). Reconnect the credential choosing a wider level — its id stays the same, every node keeps working.

ℹA Service Account also works, but it has no Drive storage of its own: uploads fail unless they go to a Shared Drive the service account's email was added to. For personal Drives use OAuth (your Google account).

2. Mode

Single operation

The normal choice. The node runs one Drive operation every time an event reaches it — the one you pick under Operation — with the fields you fill in. Deterministic, no AI involved, free.

AI toolkit

The node stops running by itself and becomes a set of twelve tools for an AI Node upstream: the assistant decides which to call and with what, from the conversation. Use it when a person asks the assistant things like “find the contract from March and share it with Ana”. Details in AI toolkit mode.


3. Default folder

Where the node works when an operation doesn't say otherwise. Toggle My Drive / Shared Drives at the top, then walk the folders (Root → Documentos Legales → …) and pick one. The chosen folder shows under the list with a Reset to go back to the root of My Drive.

  • Upload and Create folder put things here.
  • List / Search looks here.
  • Copy and Move use it as the destination.

Each of those operations also has a Parent Folder ID (override) field under its Advanced tab. Fill it to send just that operation somewhere else — it accepts a template like {{payload.folderId}}, so a webhook can decide the folder per event. Empty means “use the Default folder”.

ℹRefresh re-reads the folder list from Google. Folders you create in Drive while this page is open don't appear until you press it.

4. Operation

Pick one of twelve. Each shows its own fields under Config, and the rarer ones under Advanced. Every text field accepts templates — {{payload.name}} takes the value from the event that triggered the flow. Where an operation asks for a Drive File, you can either pick one from Drive (fixed) or paste a template like {{payload.driveFileId}} (one file per event — e.g. the file a Drive trigger just reported).

Upload File

Takes a file the flow already holds and saves it to Drive. Typical source: a webhook that received a form with a file, or a File Transform / Download step earlier in the flow.

  • Destination File Name — leave blank to keep the file's original name.
  • Source Field — where the file reference lives in the event. Default _file; for a multipart webhook the first upload is _files[0]._file; a Drive trigger puts it at file._file.
  • File type filter — only upload when the file is of this type; other events are skipped.
  • Advanced: Parent Folder ID (override).

Output: the new Drive file — fileId, name, url, size and type.

Download File

Fetches one file from Drive and attaches it to the event as _file — for an AI Node to read, a Vector Store to ingest, an Email action to attach, or another Drive action to copy elsewhere.

  • Drive File — pick it, or template the id.

Google-native documents (Docs, Sheets, Slides) can't be downloaded as-is; use Export Google Doc for those.

List / Search

Lists the files in the Default folder (or the override), optionally filtered. This is the operation in the screenshot of this page. Its output is a list: nodes after it run once per file, so “Vector Store” after “List” ingests each file on its own.

  • Search Query — a piece of the file name. Empty lists everything.
  • File type filter — PDF, images, Google Docs… or Any.
  • Max Results — up to 100 per run (default 50).
  • Order By — modified or created time, newest or oldest first; name A→Z or Z→A.

Advanced:

  • Parent Folder ID (override) — look in another folder for this operation only.
  • Search subfolders too — Drive only lists a folder's direct contents, so the node walks the folder tree itself, from the starting folder down. Needs a starting folder (it refuses to walk a whole Drive), stops at 200 folders or Max Results matches, and costs one Drive call per folder — big trees take a while.
  • Limit to specific subfolders — with the above on, restrict the walk to the subfolders you tick.
  • Auto-download matching files — every match arrives with its _file already attached, so the next node can read the contents without another Drive step. Off by default: it costs one download per match. Combined with subfolders it's the one-shot “every PDF in this folder and below” flow.

Output: files[] with id, name, type, size, modified time, link and parent folder for each — and the file reference when Auto-download is on. The Output panel shows them as cards with Open in Drive.

Get Metadata

Name, type, size, dates, link and folder of one file — without downloading it. Useful to decide something (“is it a PDF? newer than yesterday?”) with a Filter node after it.

Copy File

Duplicates a file. New File Name is optional (empty keeps the name); the copy lands in the Default folder or the Advanced override.

Move File

Moves a file into the Default folder (or the Advanced override). The file keeps its id, so links to it keep working.

Delete (Trash)

Sends the file to Drive's trash, where it can be restored for 30 days. Delete Permanently? — off by default. The “erase forever” option skips the trash and cannot be undone; keep it off unless a retention rule requires it. In a Shared Drive only a Manager can erase for good (in My Drive, the owner): with any other role the node says so and the file stays. If the account may still trash it (a Content manager in a Shared Drive), the message says to turn off Delete permanently.

Share File

  • Share With — a specific user (email), a group (email), an entire domain, or anyone with the link. The last one makes the file public: the option is marked with a warning for a reason.
  • Permission Role — Viewer, Commenter or Editor.
  • Email Address (user / group) or Domain (domain). Templates work: {{payload.email}}.
  • Notify Recipient — whether Google sends its share email.

Update Metadata

Rename (New Name), set a Description, star or un-star. Leave a field empty to keep it as it is. This never touches the file's contents.

Create Folder

Creates a folder named Folder Name inside the Default folder (or the Advanced override). Output: the new folder's id — ({{payload.folderId}}) — template it into a following Upload's override to fill it right away.

Export Google Doc

Turns a Google Doc, Sheet, Slides or Drawing into a regular file and attaches it as _file. Export Format: PDF (any of them), Word for Docs, Excel for Sheets, PowerPoint for Slides, plain text, CSV, HTML. For files that are already regular (a PDF you uploaded) use Download instead.

List Permissions

Who has access to a file and with what role. Run it before Share to audit, or to decide whether to share at all.


5. Run Test

Runs the operation right now with what you configured, against your real Drive, and shows the result in Output. With no input connected it runs with an empty event — enough for List, Get or a fixed Drive File. For operations that need event data (a template like {{payload.driveFileId}}), open Advanced (optional) under Run Test and paste a sample event.

ℹA test does what the operation does. Testing Delete trashes the file; testing Share shares it. Test destructive operations on a scratch file.

6. Output

The right column shows what the last run produced: the same result the next node receives. JSON is the raw shape, Schema lists every field with its path (copy it straight into a template), Table shows lists as rows. Files show as cards with Open in Drive. Pin output keeps this result as the example the next nodes' pickers offer.

Paths you'll template most often:

List / Search       → {{payload.files[0].name}}   (each file on its own in the next node: {{payload.name}}, {{payload.id}}, {{payload.url}})
Upload File         → {{payload.fileId}}  {{payload.name}}  {{payload.url}}
Get Metadata        → {{payload.id}}  {{payload.name}}  {{payload.mimeType}}  {{payload.modifiedTime}}  {{payload.url}}
Copy File           → {{payload.copyFileId}}  {{payload.name}}  {{payload.url}}
Download / Export   → {{payload._file}}  (the file itself: attach it, read it, ingest it)
Create Folder       → {{payload.folderId}}  (the new folder's id)
List Permissions    → {{payload.permissions[0].emailAddress}}  (one per permission in the next node)

AI toolkit mode

Switch Mode to AI toolkit and connect the node as a tool of an AI Node (AI Node → Tools → Add tool → Node). The assistant then gets twelve tools, grouped so it knows what is safe:

  • Files in / out — upload, download, export.
  • Discovery — list / search, get metadata, list permissions.
  • Mutations — copy, move, update, create folder, delete, share. The assistant is instructed to confirm with the person before any of these.

The Default folder and the credential still apply: the assistant works as that Google account, inside that folder unless told otherwise. The same node can also be exposed to external assistants through Settings → MCP Servers.

AI workspace: where the assistant may work

Under the tools, AI Workspace limits the assistant to one place: anywhere the account reaches (the default), one Shared Drive, or one folder of My Drive. With a Shared Drive or a folder picked, HostWebhook checks every tool call on the server, whatever the assistant asks for:

  • the file it reads, changes, shares or deletes has to be inside;
  • the folder it creates, uploads, copies or moves into has to be inside too;
  • a call that names no folder goes to the root of that Shared Drive or that folder (a copy stays next to the original), and a list without a folder searches the whole Shared Drive — never the Default folder or My Drive;
  • with a folder picked, only that folder's own files count, and listing another folder is refused.

A refused call tells the assistant only that the file or folder is outside the area it may use — not its name, nor how the node is set up — because what the assistant reads can end up in a public chat.


Large files

Uploads and downloads stream between Drive and HostWebhook's storage; nothing is held in memory, so file size is limited by your plan's storage caps, not by the node. Downloaded and exported files count against your storage until the flow's retention removes them.


Flows people build with it

Save form attachments to Drive

Webhook (a form with a file)
  → Drive Action — Upload File (Source Field: _files[0]._file, Default folder: "Uploads")
  → Notification (Slack: "New file in Drive: {{payload.name}}")

Load a folder into a vector store

Scheduled Workflow (nightly)
  → Drive Action — List / Search (File type: PDF, Advanced: Search subfolders too + Auto-download)
  → Vector Store (Content type: PDF)   ← runs once per file

Weekly PDF of a Google Doc, by email

Scheduled Workflow (Mondays 9am)
  → Drive Action — Export Google Doc (Export Format: PDF)
  → Email Action (attachment: {{payload._file}})

File a Drive upload where it belongs

Drive Trigger (Created, folder "Inbox")
  → Filter (name contains "invoice")
  → Drive Action — Move File (Drive File: {{payload.file.id}}, Default folder: "Invoices")

Troubleshooting

“Insufficient permission” / the operation is refused

The credential's level (file-only, read-only, full) doesn't cover the operation: moving, deleting, sharing or renaming a file the app didn't create needs Full. Open the credential under Settings → Credentials and Reconnect choosing the wider level — the credential keeps its id and this node keeps working.

List / Search returns nothing, but the folder has files

With a file-only credential the app only sees files it created or that were picked through a Google picker; everything else is invisible to it. Reconnect with read-only or full. Also check the File type filter and that the Default folder is the one you mean (Reset returns to the root of My Drive). A folder of a Shared Drive is listed inside its drive even when the folder id comes from a template or from the assistant and no drive is picked.

Upload fails with a storage error using a Service Account

Service accounts have no Drive storage. Either upload to a Shared Drive the service account's email was added to, or use your own Google account (OAuth).

Download gives an error on a Google Doc / Sheet

Native Google documents have no file to download. Use Export Google Doc and pick the format.

The next node doesn't see the file

After Download or Export the file is at {{payload._file}}; after List with Auto-download, each file carries its own _file. Check the Output panel's Schema tab for the exact path and use that in the next node.

Search subfolders is slow or stops early

It costs one Drive call per folder and stops at 200 folders or Max Results matches. Narrow it with Limit to specific subfolders, raise Max Results (up to 100), or point the Default folder deeper in the tree.