Skip to content

Updating visuals

If you see any images containing outdated UI, please bear with us.

We are updating all content as quickly as possible to mirror our new UI.

Google Drive integration

Google Drive is Google's file storage and sharing service. This integration lets your WeWeb backend list and search files, download and export content (PDF, Word, Markdown and more), upload and copy files into Shared Drives, create folders, move and rename files, manage sharing, and expose Drive files as a data table, all through a Google Cloud service account.

Use cases

  • Generate documents from templates: copy a template Doc, fill it, and export it as a PDF.
  • Let users upload files from your app straight into a Shared Drive.
  • Build a file browser or admin screen on top of a Drive folder using a table.
  • Convert Markdown produced by a workflow into a real Google Doc.
  • Share generated files with a user, a group, or anyone with the link, and revoke access later.

Setup

Google Drive authenticates with a service account: a robot Google identity that belongs to your Google Cloud project. You create it once, download its JSON key, and share your Drive files with its email address the same way you would share with a person.

  1. Sign in to Google Cloud Console.
  2. Create a project or select an existing one.
  3. Enable the Google Drive API.
  4. Go to IAM & AdminService Accounts and click Create service account.
  5. Name the service account and click Create and continue, then skip role assignment and click Done.
  6. Open the service account menu (three dots) → Manage keysAdd keyCreate new keyJSON, then download the key file.
  7. In WeWeb, open Data & APIIntegrations, select Google Drive, and click Add Connection.
  8. Click Upload JSON Key to auto-fill the connection, or fill the fields manually:
    • Client Email, The service account email from the JSON key (client_email)
    • Private Key, The private key from the JSON key (private_key)
  9. Share the files or folders you want to use with the service account email (as viewer or editor), exactly like sharing with a person.
  10. To create files (upload, copy), add the service account as a Content manager member of a Shared Drive. Shared Drives require Google Workspace.
  11. Test with the List Files action: it should return the files you shared in step 9.

WHY A SHARED DRIVE?

Service accounts cannot own files: they have zero storage quota, so any file they would own is rejected by Google with a storageQuotaExceeded error. Files in a Shared Drive are owned by the drive itself, not by whoever created them, which is why uploads and copies must target a Shared Drive (or a folder inside one).

How Google Drive works with a service account

A few Drive concepts shape every action on this page.

The service account only sees what you share with it

The integration acts as the service account, not as you. List Files returns anything shared with the service account email plus the Shared Drives it is a member of, and nothing else. A file that exists in your Drive but was never shared with the service account behaves as if it does not exist (Google reports it as not found).

File IDs

Every file and folder has a permanent ID: the long string in its URL (e.g. 1AbC9DeFgHiJkLmNoPqRsTuVwXyZ), also returned as id by List Files and Get File. All actions take file IDs, never names or paths.

Folders and shortcuts are files too

A folder is just a file with the MIME type application/vnd.google-apps.folder. A shortcut (application/vnd.google-apps.shortcut) points at a real file: shortcuts appear in listings but cannot be downloaded; the real file's ID is in shortcutDetails.targetId.

Google-native files vs binary files

Google-native files (Docs, Sheets, Slides, Drawings; their mimeType starts with application/vnd.google-apps.) have no binary content of their own:

  • Use Export File to convert a native file to PDF, Word, Markdown, CSV and other formats. Download File rejects native files.
  • Use Download File for everything else (PDFs, images, uploads). Binary files cannot be exported.
  • Native files and folders have no size: that property is null or absent for them.

Content travels as base64, with size caps

Download File and Export File return the file bytes as a base64 string, and Upload File accepts base64 (or a bound file). Practical limits, enforced by the platform and by Google:

  • ~4 MB of content per action result or base64 input (server payload limit)
  • 6 MB for files bound into a workflow through a file-type parameter (client-enforced)
  • 10 MB for Google's own export cap on native files

For bigger uploads, use the Public URL content source: the server downloads the file from the URL itself, sidestepping the base64 cap.

Creating files requires a Shared Drive

Upload File and Copy File must target a Shared Drive or a folder inside one, where the service account is a member (Content manager or above). Targeting a regular My Drive folder fails with storageQuotaExceeded, even if that folder is shared with the service account. One exception: Create Folder also works in a shared My Drive folder, because folders cost no storage quota, but files still cannot be created inside such a folder, so prefer Shared Drives throughout.

Shared Drive items have no owner

Files in a Shared Drive are owned by the drive, so owners is absent on them (and the table's owner column is null). List File Shares on a Shared Drive item reflects drive membership plus direct shares.

Searching with queries

List Files (and the table's Search Query field) accept the Google Drive query language: term operator value clauses joined by and, or and not. String values are wrapped in single quotes (escape ' as \').

ClauseWhat it matches
name contains 'report'Files whose name contains "report"
'FOLDER_ID' in parentsDirect children of a folder (not recursive)
mimeType = 'application/vnd.google-apps.folder'Only folders (use != to exclude folders)
fullText contains 'invoice'Full-text search in file content
modifiedTime > '2026-01-01T00:00:00'Files modified after a date
starred = trueStarred files

Two behaviors specific to this integration:

  • Trashed files are excluded automatically: WeWeb appends trashed = false to your query unless the query already mentions trashed.
  • Folder scoping only matches direct children. There is no recursive folder search; combine fullText contains with no folder clause to search content across everything visible.

Pagination

List results are paginated with a cursor: each page can include a nextPageToken, which you pass back as Page Token to get the next page. Tokens only page forward; there is no way to jump to an arbitrary page. List Files returns up to 1000 results per page (100 when Page Size is empty); List Shared Drives returns up to 100 per page (10 when empty).

Using Google Drive as a data source for tables

Besides workflow actions, you can use Google Drive as a data source for tables in WeWeb. A Google Drive table lists the files visible to the service account and exposes them to table components (e.g. Data Grid) and the Table View: Fetch action.

  1. In WeWeb, go to the Data & API tab, open the Tables subtab, and add a table with Google Drive as the source, then select your connection.
  2. Select the Table resource: only Files exists (it is powered by the same file listing as List Files).
  3. Configure a view with any of these optional fields:
    • Folder: Only show files directly inside this folder or Shared Drive ID.
    • Shared Drive: Restrict rows to one Shared Drive (get its ID from the List Shared Drives action).
    • Search Query: A Drive query language filter, ANDed with the folder filter. E.g. mimeType != 'application/vnd.google-apps.folder' to hide folders. Trashed files are always excluded.
    • Order By: Comma-separated sort keys (name, modifiedTime, createdTime, folder, starred...), each optionally followed by desc.

Rows arrive flattened with these columns: id, name, mimeType, size (a number; null for folders and Google-native files), modifiedTime, createdTime, owner (the first owner's email; null on Shared Drive items), webViewLink, parent (the first parent folder ID). Pagination is cursor-based: the view's limit defaults to 100 (max 1000), and the next-page cursor is the listing's nextPageToken.

For the general pattern of tables, views, and fetching data, see Working with data.

Common pitfalls (setup & usage)

Upload or copy fails with storageQuotaExceeded

Google rejects any file the service account would own, because service accounts have zero storage quota (the error message itself says "Service Accounts do not have storage quota. Leverage shared drives..."). Point Destination Folder at a Shared Drive, or a folder inside one, where the service account is a Content manager member. Sharing a My Drive folder with the service account is not enough.

List Shared Drives returns an empty list

{ "drives": [] } means the service account has not been added as a member of any Shared Drive, so uploads and copies will fail until you add it. Shared Drives only exist on paid Google Workspace plans; a free Gmail account cannot create one, so a free-Gmail setup can read and edit shared files but never create files.

"File not found" on a file that exists

Drive reports files the service account cannot see as not found (404). Check that the file, or a folder above it, is shared with the exact service account email (Client Email), then retry.

Trash fails on a shared My Drive file

In a My Drive, only the file's owner can trash it. Trash File on a file merely shared with the service account fails with 403 insufficientFilePermissions, even though the file can still be edited. Trashing works normally on Shared Drive items. If you only need to cut access, use Revoke File Share instead.

Revoking access inherited from Shared Drive membership

Revoke File Share can only remove direct, per-file shares. Access someone has because they are a member of the Shared Drive cannot be revoked file by file: Google returns 403 "The authenticated user cannot delete the permission". Remove the person from the drive, or move the file, instead.

Downloading a Google Doc, Sheet or Slides

Google-native files have no binary content, so Download File rejects them with an instructional error. Use Export File and pick a format valid for the source type (e.g. PDF for a Doc).

Query returns nothing because of quoting

String values in the Search Query use single quotes: name contains 'report'. Escape a literal ' as \'. Also remember the folder clause 'FOLDER_ID' in parents only matches direct children, not files in subfolders.

All Actions

Fourteen actions, grouped by what they do. Each action name links to its details below.

Find and read files

ActionDescription
List FilesList or search everything visible to the service account, with the Drive query language and cursor pagination.
Get FileGet the metadata of one file or folder by ID (name, type, size, links, parents).
Download FileDownload a binary file's content as base64 (PDFs, images, uploads).
Export FileConvert a Google-native file (Doc, Sheet, Slides, Drawing) to another format and download it as base64.

Create and organize

ActionDescription
Upload FileUpload a file into a Shared Drive from a bound file, base64 content, or a public URL; optionally convert it to a Google-native file.
Create FolderCreate a folder.
Copy FileCopy a file (e.g. a template) into a Shared Drive.
Update FileRename, describe, star/unstar, and/or move a file between folders.

Trash and delete

ActionDescription
Trash FileMove a file or folder to the trash (recoverable for ~30 days).
Delete File PermanentlyPermanently delete a file or folder, skipping the trash. Irreversible.

Sharing

ActionDescription
Share FileGrant a role on a file or folder to a user, group, domain, or anyone with the link.
List File SharesList who has access to a file or folder.
Revoke File ShareRemove an existing share by permission ID.

Shared Drives

ActionDescription
List Shared DrivesList the Shared Drives the service account is a member of.

Action details

List Files

List or search Google Drive files and folders visible to the service account (anything shared with its email plus Shared Drives it belongs to), with the Drive query language and cursor pagination.

Inputs

Display KeyExample InputDescriptionRestrictions
Search Query
Optional
name contains 'report'Drive query language filter: term operator value clauses joined by and / or / not. Leave empty to list everything visible to the service account.String values in single quotes (escape ' as \'). Trashed files are excluded unless the query mentions trashed
Shared Drive
Optional
0AIabCdEfGhIjUk9PVARestrict results to one Shared Drive (picked from the list, or bound as an ID). Empty spans all Shared Drives plus files shared directly with the service account.Shared Drive ID
Order By
Optional
folder, modifiedTime descComma-separated sort keys, each optionally followed by desc.Valid keys: name, modifiedTime, createdTime, folder, quotaBytesUsed, recency, starred, viewedByMeTime
Page Size
Optional
100Maximum number of results per page. Empty returns 100.Between 1 and 1000
Page Token
Optional
~!!~AI9FV7Q...Pagination cursor: the nextPageToken from the previous List Files response. Empty for the first page.Forward-only
Fields
Optional
files(id, name, mimeType)Google fields mask selecting which properties to return. Empty uses a rich default.Google fields mask syntax

Example output

json
{
  "files": [
    {
      "id": "1AbC9DeFgHiJkLmNoPqRsTuVwXyZ",
      "name": "report.pdf",
      "mimeType": "application/pdf",
      "size": "48231",
      "modifiedTime": "2026-09-01T10:24:00.000Z",
      "createdTime": "2026-08-15T09:00:00.000Z",
      "webViewLink": "https://drive.google.com/file/d/1AbC9DeFgHiJkLmNoPqRsTuVwXyZ/view",
      "parents": ["0AIabCdEfGhIjUk9PVA"],
      "trashed": false
    }
  ],
  "nextPageToken": "~!!~AI9FV7Q..."
}

size is a string in raw Drive metadata, and is absent on folders and Google-native files. nextPageToken is only present when there are more pages.

Documentation of API endpoint that powers action: Google Drive API – Files: list (GET /drive/v3/files)

Get File

Get the metadata of a Google Drive file or folder by ID (name, type, size, links, parents). Does not return file content: use Download File or Export File for that.

Inputs

Display KeyExample InputDescriptionRestrictions
File ID1AbC9DeFgHiJkLmNoPqRsTuVwXyZGoogle Drive file or folder ID: the long ID from the file URL, or the id of a listed file.Required
Fields
Optional
id, name, mimeType, webViewLinkGoogle fields mask selecting which properties to return. Empty uses a rich default.Google fields mask syntax

Example output

json
{
  "id": "1AbC9DeFgHiJkLmNoPqRsTuVwXyZ",
  "name": "Quarterly report",
  "mimeType": "application/vnd.google-apps.document",
  "modifiedTime": "2026-09-01T10:24:00.000Z",
  "createdTime": "2026-08-15T09:00:00.000Z",
  "webViewLink": "https://docs.google.com/document/d/1AbC9DeFgHiJkLmNoPqRsTuVwXyZ/edit",
  "parents": ["0AIabCdEfGhIjUk9PVA"],
  "trashed": false,
  "shared": true,
  "driveId": "0AIabCdEfGhIjUk9PVA",
  "exportLinks": { "application/pdf": "https://docs.google.com/feeds/download/documents/export/Export?id=..." }
}

Documentation of API endpoint that powers action: Google Drive API – Files: get (GET /drive/v3/files/{fileId})

Download File

Download the content of a binary Google Drive file (PDF, image, zip, uploaded document) as base64.

Google-native files (Docs, Sheets, Slides) have no binary content and are rejected with an instructional error pointing to Export File. Shortcuts are rejected too; the error includes the real file's ID (shortcutDetails.targetId). Files larger than ~4 MB exceed the server response limit.

Inputs

Display KeyExample InputDescriptionRestrictions
File ID1AbC9DeFgHiJkLmNoPqRsTuVwXyZGoogle Drive file ID of a binary file (PDF, image, zip, uploaded file).Required. Not a Google-native file or a shortcut; ~4 MB practical cap

Example output

json
{
  "name": "report.pdf",
  "mimeType": "application/pdf",
  "size": 48231,
  "base64": "JVBERi0xLjcKJc..."
}

size is a number here (null when Drive does not report one).

Documentation of API endpoint that powers action: Google Drive API – Files: get with alt=media (GET /drive/v3/files/{fileId}?alt=media)

Export File

Convert a Google-native file (Doc, Sheet, Slides, Drawing) to another format and download it as base64.

Binary files (PDFs, images, uploads) cannot be exported and are rejected with an instructional error pointing to Download File. Google caps exports at 10 MB; the server payload limit makes ~4 MB the practical cap.

Inputs

Display KeyExample InputDescriptionRestrictions
File ID1AbC9DeFgHiJkLmNoPqRsTuVwXyZGoogle Drive file ID of a Google-native file (Doc, Sheet, Slides, Drawing).Required
Export Formatapplication/pdfTarget format. Valid choices depend on the source type: Docs → PDF, Word, Plain text, Markdown, HTML · Sheets → PDF, Excel, CSV (first sheet only) · Slides → PDF, PowerPoint, Plain text · Drawings → PNG, PDF.Required. Valid: application/pdf, application/vnd.openxmlformats-officedocument.wordprocessingml.document, text/plain, text/markdown, text/html, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, text/csv, application/vnd.openxmlformats-officedocument.presentationml.presentation, image/png

Example output

json
{
  "name": "Quarterly report",
  "mimeType": "application/pdf",
  "base64": "JVBERi0xLjcKJc..."
}

Documentation of API endpoint that powers action: Google Drive API – Files: export (GET /drive/v3/files/{fileId}/export)

Upload File

Upload a file to Google Drive from a bound file, base64 content or a data URI, or from a public URL fetched server-side. The destination must be a Shared Drive (or a folder inside one). Can also convert the content to a Google-native file (e.g. Markdown to a Google Doc).

Inputs

Display KeyExample InputDescriptionRestrictions
Destination Folder0AIabCdEfGhIjUk9PVAWhere to create the file: pick a Shared Drive (its root) from the list, or bind the ID of a folder inside a Shared Drive.Required. My Drive folders fail with storageQuotaExceeded
Content SourceFile / contentWhere the file bytes come from. A UI toggle between the two fields below; the backend uses whichever of File Content / Content URL is filled.Valid: File / content, Public URL
File Contentcontext.parameters['file']The file to upload: bind a file (e.g. an Upload element's file passed through a file-type workflow parameter), or paste/bind base64 content or a data URI (e.g. the output of an Export/Download action).Required when the source is File / content. ~4 MB practical cap (file uploads to workflows cap at 6 MB)
Content URLhttps://example.com/report.pdfA publicly accessible URL: the server downloads the file from it and uploads it to Drive. Sidesteps the ~4 MB base64 cap.Required when the source is Public URL
File Name
Optional
report.pdfName of the file to create, including its extension. Empty uses the bound file's own name (or Google names it Untitled).
Content MIME Type
Optional
application/pdfMIME type of the uploaded content. Empty takes it from the URL response, the bound file, or Google's detection.
Convert To
Optional
application/vnd.google-apps.documentConvert the uploaded content into a Google-native file. E.g. upload text/markdown content and convert to a Google Doc.Valid: application/vnd.google-apps.document, application/vnd.google-apps.spreadsheet, application/vnd.google-apps.presentation

Provide exactly one of File Content or Content URL. Running the action with neither fails with an instructional error rather than creating an empty file.

Example output

json
{
  "id": "1NeW9FiLeIdAbCdEfGhIjKlMnOp",
  "name": "report.pdf",
  "mimeType": "application/pdf",
  "size": "48231",
  "modifiedTime": "2026-09-01T10:24:00.000Z",
  "createdTime": "2026-09-01T10:24:00.000Z",
  "webViewLink": "https://drive.google.com/file/d/1NeW9FiLeIdAbCdEfGhIjKlMnOp/view",
  "parents": ["0AIabCdEfGhIjUk9PVA"],
  "trashed": false,
  "shared": false,
  "driveId": "0AIabCdEfGhIjUk9PVA"
}

Documentation of API endpoint that powers action: Google Drive API – Files: create (POST /upload/drive/v3/files)

Create Folder

Create a folder in Google Drive.

Inputs

Display KeyExample InputDescriptionRestrictions
Folder NameInvoices 2026Name of the folder to create.Required
Parent Folder0AIabCdEfGhIjUk9PVAWhere to create the folder: pick a Shared Drive (its root) from the list, or bind the ID of a folder inside a Shared Drive. A My Drive folder shared with the service account also works for the folder itself, but files can never be created inside it, so prefer a Shared Drive.Required

Example output

json
{
  "id": "1FoLdErIdAbCdEfGhIjKlMnOp",
  "name": "Invoices 2026",
  "mimeType": "application/vnd.google-apps.folder",
  "createdTime": "2026-09-01T10:24:00.000Z",
  "modifiedTime": "2026-09-01T10:24:00.000Z",
  "webViewLink": "https://drive.google.com/drive/folders/1FoLdErIdAbCdEfGhIjKlMnOp",
  "parents": ["0AIabCdEfGhIjUk9PVA"],
  "trashed": false,
  "driveId": "0AIabCdEfGhIjUk9PVA"
}

Documentation of API endpoint that powers action: Google Drive API – Files: create (POST /drive/v3/files)

Copy File

Copy a Google Drive file into a Shared Drive. The source can live anywhere shared with the service account, including a template in someone's My Drive. This is the classic template flow: copy a template Doc, then edit and export the copy.

Inputs

Display KeyExample InputDescriptionRestrictions
Source File ID1AbC9DeFgHiJkLmNoPqRsTuVwXyZGoogle Drive file ID to copy. The source can live anywhere the service account can read.Required. Folders cannot be copied
Destination Folder0AIabCdEfGhIjUk9PVAWhere to put the copy: pick a Shared Drive (its root) from the list, or bind the ID of a folder inside a Shared Drive.Required. My Drive destinations fail with storageQuotaExceeded (the copier owns the copy)
Copy Name
Optional
Invoice #123Name for the copy. Empty lets Google name it Copy of <original name>.

Example output

json
{
  "id": "1CoPyIdAbCdEfGhIjKlMnOp",
  "name": "Invoice #123",
  "mimeType": "application/vnd.google-apps.document",
  "createdTime": "2026-09-01T10:24:00.000Z",
  "modifiedTime": "2026-09-01T10:24:00.000Z",
  "webViewLink": "https://docs.google.com/document/d/1CoPyIdAbCdEfGhIjKlMnOp/edit",
  "parents": ["0AIabCdEfGhIjUk9PVA"],
  "trashed": false,
  "driveId": "0AIabCdEfGhIjUk9PVA"
}

Documentation of API endpoint that powers action: Google Drive API – Files: copy (POST /drive/v3/files/{fileId}/copy)

Update File

Update a Google Drive file or folder: rename, change its description, star or unstar it, and/or move it between folders. Only the fields you fill in change. Requires editor access on the file.

Inputs

Display KeyExample InputDescriptionRestrictions
File ID1AbC9DeFgHiJkLmNoPqRsTuVwXyZGoogle Drive file or folder ID to update.Required
New Name
Optional
report-final.pdfRename the file. Empty leaves the name unchanged.
Description
Optional
Final version approved by legalShort description shown in the file's details panel. Empty leaves it unchanged.
Starred
Optional
trueStar or unstar the file. Empty leaves it unchanged.Valid: true, false (as strings)
Move To (folder ID)
Optional
0AIabCdEfGhIjUk9PVAFolder ID to move the file into. Use together with Remove From to move (a file usually has one parent); with only Move To, the file ends up in two places.Moving into a Shared Drive from a My Drive needs the right roles on both sides
Remove From (folder ID)
Optional
1QrStUvWxYz2AbCdEfFolder ID to remove the file from: usually the current parent (see parents from Get File).

Example output

json
{
  "id": "1AbC9DeFgHiJkLmNoPqRsTuVwXyZ",
  "name": "report-final.pdf",
  "mimeType": "application/pdf",
  "size": "48231",
  "modifiedTime": "2026-09-02T08:00:00.000Z",
  "webViewLink": "https://drive.google.com/file/d/1AbC9DeFgHiJkLmNoPqRsTuVwXyZ/view",
  "parents": ["0AIabCdEfGhIjUk9PVA"],
  "trashed": false
}

Documentation of API endpoint that powers action: Google Drive API – Files: update (PATCH /drive/v3/files/{fileId})

Trash File

Move a Google Drive file or folder to the trash. Trashed items are recoverable for about 30 days, then auto-purged.

Trashing works on Shared Drive items. In a My Drive, only the file's owner can trash it, so this fails with 403 insufficientFilePermissions on files merely shared with the service account. For irreversible removal use Delete File Permanently.

Inputs

Display KeyExample InputDescriptionRestrictions
File ID1AbC9DeFgHiJkLmNoPqRsTuVwXyZGoogle Drive file or folder ID to move to the trash.Required. Owner-only in a My Drive

Example output

json
{
  "id": "1AbC9DeFgHiJkLmNoPqRsTuVwXyZ",
  "name": "report.pdf",
  "mimeType": "application/pdf",
  "trashed": true
}

Documentation of API endpoint that powers action: Google Drive API – Files: update (PATCH /drive/v3/files/{fileId})

Delete File Permanently

Permanently delete a Google Drive file or folder, skipping the trash. This cannot be undone, and deleting a folder deletes everything inside it. Prefer Trash File unless you really need irreversible removal.

Inputs

Display KeyExample InputDescriptionRestrictions
File ID1AbC9DeFgHiJkLmNoPqRsTuVwXyZGoogle Drive file or folder ID to delete permanently.Required. On Shared Drive items the service account needs the Manager role

Example output

json
{
  "success": true,
  "fileId": "1AbC9DeFgHiJkLmNoPqRsTuVwXyZ"
}

Documentation of API endpoint that powers action: Google Drive API – Files: delete (DELETE /drive/v3/files/{fileId})

Share File

Share a Google Drive file or folder: grant a role to a user, a Google group, everyone in a domain, or anyone with the link (public link sharing). The service account needs editor access, and the file must allow re-sharing.

Inputs

Display KeyExample InputDescriptionRestrictions
File ID1AbC9DeFgHiJkLmNoPqRsTuVwXyZGoogle Drive file or folder ID to share.Required
Share WithA user (email)Who receives access: a single user, a Google group, everyone in a domain, or anyone with the link.Required. Valid: user, group, domain, anyone
RoleViewerAccess level granted.Required. Valid: reader, commenter, writer, fileOrganizer, organizer (fileOrganizer and organizer only on Shared Drive items)
Email Addressjane@example.comEmail address of the user or group receiving access. Only shown when Share With is a user or group.Required for user and group
Domainexample.comDomain whose members receive access. Only shown when Share With is a domain.Required for domain
Send Notification Email
Optional
falseWhether Google emails the user or group about the new access. Only shown for users and groups. Empty lets Google send it by default.Valid: true, false (as strings)

Example output

json
{
  "id": "12345678901234567890",
  "type": "user",
  "role": "reader",
  "emailAddress": "jane@example.com",
  "displayName": "Jane Doe"
}

Keep the returned id if you may want to revoke this share later with Revoke File Share. For a public link, share with anyone as reader, then use the file's webViewLink (from Get File) as the shareable URL. Granting a role to someone who is already a Shared Drive member merges into their membership permission (a no-op if the membership role is already at least as high).

Documentation of API endpoint that powers action: Google Drive API – Permissions: create (POST /drive/v3/files/{fileId}/permissions)

List File Shares

List who has access to a Google Drive file or folder: permission ID, email or domain, role, and type. Permission IDs feed the Revoke File Share action.

Inputs

Display KeyExample InputDescriptionRestrictions
File ID1AbC9DeFgHiJkLmNoPqRsTuVwXyZGoogle Drive file or folder ID whose shares to list.Required

Example output

json
{
  "permissions": [
    { "id": "02461036989123456789", "emailAddress": "sa@project-id.iam.gserviceaccount.com", "role": "writer", "type": "user", "displayName": "drive-bot" },
    { "id": "12345678901234567890", "emailAddress": "jane@example.com", "role": "reader", "type": "user", "displayName": "Jane Doe" }
  ]
}

On Shared Drive items, the list reflects drive membership plus direct shares.

Documentation of API endpoint that powers action: Google Drive API – Permissions: list (GET /drive/v3/files/{fileId}/permissions)

Revoke File Share

Revoke an existing share on a Google Drive file or folder by permission ID (from List File Shares).

Only direct, per-file shares can be revoked. Access inherited from Shared Drive membership cannot be removed per file (Google returns 403), and the file owner's permission cannot be revoked.

Inputs

Display KeyExample InputDescriptionRestrictions
File ID1AbC9DeFgHiJkLmNoPqRsTuVwXyZGoogle Drive file or folder ID the share belongs to.Required
Permission ID12345678901234567890ID of the permission to revoke, from the List File Shares action.Required. The owner's permission cannot be revoked

Example output

json
{
  "success": true,
  "permissionId": "12345678901234567890"
}

Documentation of API endpoint that powers action: Google Drive API – Permissions: delete (DELETE /drive/v3/files/{fileId}/permissions/{permissionId})

List Shared Drives

List the Shared Drives the service account is a member of. A Shared Drive ID works as a destination folder for Upload File, Copy File and Create Folder, and as the Shared Drive scope for listings. An empty list means the service account has not been added to any Shared Drive.

Inputs

Display KeyExample InputDescriptionRestrictions
Page Size
Optional
10Maximum number of results per page. Empty returns 10.Between 1 and 100
Page Token
Optional
~!!~AI9FV7Q...Pagination cursor: the nextPageToken from the previous List Shared Drives response. Empty for the first page.Forward-only

Example output

json
{
  "drives": [
    { "id": "0AIabCdEfGhIjUk9PVA", "name": "Marketing", "createdTime": "2026-01-10T08:00:00.000Z" }
  ]
}

nextPageToken is only present when there are more pages.

Documentation of API endpoint that powers action: Google Drive API – Drives: list (GET /drive/v3/drives)

Error handling

Errors come from two places, and they read differently:

  • WeWeb pre-flight checks fail with instructional messages before calling Google, e.g. downloading a Google-native file ("use the Export File action instead"), downloading a shortcut (the message includes the target file's ID), exporting a binary file, uploading with no content, a Content URL that cannot be fetched, or a missing/incomplete connection.
  • Google API errors pass through to the workflow result verbatim, with Google's domain, reason and location details intact, so you can match on reasons like storageQuotaExceeded or insufficientFilePermissions.
Error code and typeReason
400 Bad RequestInvalid Search Query syntax, invalid page token, or an export format that is not valid for the source file type.
401 UnauthorizedInvalid or malformed service account credentials (Client Email / Private Key mismatch).
403 ForbiddenstorageQuotaExceeded: creating a file in a My Drive (use a Shared Drive). insufficientFilePermissions: trashing a My Drive file the service account does not own, or editing without editor access. Also returned when revoking a Shared-Drive-membership permission, or when the Google Drive API is not enabled in the project.
404 Not FoundFile, folder or permission ID does not exist, or the file is not visible to the service account (not shared with it).
429 Too Many RequestsDrive API rate limit reached; reduce concurrency and retry with backoff.
500 Internal Server ErrorGoogle-side error; retry with backoff.

FAQs

Why does Upload File or Copy File fail with storageQuotaExceeded?

Service accounts cannot own files (they have zero storage quota). Set Destination Folder to a Shared Drive, or a folder inside one, where the service account is a member with the Content manager role or above. Sharing a My Drive folder with the service account is not enough for creating files.

Why does List Files return nothing?

The service account only sees what is shared with it. Share the files or folders with the exact Client Email from your connection (as viewer or editor), or add the service account to a Shared Drive, then run the action again.

Why is List Shared Drives empty?

The service account has not been added as a member of any Shared Drive. Shared Drives require Google Workspace; a free Gmail account cannot create one, so with a free-Gmail setup the integration can read and edit shared files but never create files.

How do I download a Google Doc, Sheet or Slides file?

Use Export File with a format valid for the source type (e.g. PDF or Markdown for a Doc, CSV or Excel for a Sheet). Download File only works on binary files and rejects Google-native ones.

How do I create a public link to a file?

Run Share File with Share With set to Anyone with the link and Role set to Viewer. Then use the file's webViewLink (from Get File or List Files) as the shareable URL.

How do I let users upload files from my app into Drive?

Give the backend workflow a file-type parameter, bind the Upload element's file to it in the frontend Execute backend workflow action, and bind that parameter (context.parameters['file']) into File Content of Upload File. The file's own name and MIME type are used automatically when File Name and Content MIME Type are left empty. Workflow file uploads cap at 6 MB; for bigger files, use the Public URL content source.

How do I move a file to another folder?

Use Update File with Move To set to the destination folder ID and Remove From set to the current parent (read it from parents in Get File). Use both together, or the file ends up in two places.

Why is size null for some files?

Folders and Google-native files (Docs, Sheets, Slides) have no binary size, so size is null or absent for them. Only binary files (PDFs, images, uploads) report a size.

Why can't I trash a file that was shared with the service account?

In a My Drive, only the file's owner can trash it: Trash File fails with 403 insufficientFilePermissions on files merely shared with the service account, even though editing still works. Trashing works normally on Shared Drive items. To cut off access instead, use Revoke File Share.