Google Drive Steps
These steps work in Google Drive as a Google Cloud service account. They all
need the drive_service_account credential; see
Google Drive credential. A
folder id is the last part of the folder’s Drive address, after
/folders/. Shared drives are supported.
drive_find_folder
Section titled “drive_find_folder”Looks up a folder inside a parent folder. Read-only.
| Setting | Required | What it does | Default |
|---|---|---|---|
parent_id | Yes | The folder to look in. | — |
name | Yes | The folder name. | — |
exact_match | No | False matches names that contain name. | true |
Output: found, and when found id, name, web_view_link. The
first match is returned; trashed folders are ignored.
drive_find_or_create_folder
Section titled “drive_find_or_create_folder”Returns the folder with that name in the parent, creating it if there is none. Safe to run twice.
| Setting | Required | What it does |
|---|---|---|
parent_id | Yes | The parent folder. |
name | Yes | The folder name, for example "{{ labels.company }} — {{ now('Y-m') }}". |
Output: id, name, web_view_link, was_created.
drive_create_folder
Section titled “drive_create_folder”Creates a folder.
| Setting | Required | What it does | Default |
|---|---|---|---|
parent_id | Yes | The parent folder. | — |
name | Yes | The folder name. | — |
allow_duplicate | No | Create a new folder even when one with this name exists. Otherwise the existing folder is returned. | false |
Output: id, name, web_view_link.
drive_upload_file
Section titled “drive_upload_file”Uploads the file from one of the entry’s file fields. Files over 5 MB are sent in 8 MB parts.
| Setting | Required | What it does | Default |
|---|---|---|---|
parent_id | Yes | The folder to upload into. | — |
file_field | Yes | The form’s file field key. | — |
rename_to | No | A new file name. | The uploaded name |
Output: id, name, web_view_link, size, mime_type. When the
field has no file, the step succeeds with skipped: true and
reason: "no_file".
Only the first file of a multi-file field is uploaded. The file must still
be on the server: after fre_delete_entry the step fails with
file_not_found. Each run uploads a new copy.
drive_create_text_file
Section titled “drive_create_text_file”Creates a file from text, such as a submission summary.
| Setting | Required | What it does | Default |
|---|---|---|---|
parent_id | Yes | The folder. | — |
name | Yes | The file name with extension, such as summary.md. | — |
content | Yes | The text. At most 1 MB. | — |
mime_type | No | For example text/markdown, text/html, application/json. | text/plain |
Output: id, name, web_view_link, size, mime_type. Content over
1 MB fails with invalid_input. Each run creates a new file.
drive_share_link
Section titled “drive_share_link”Adds a sharing permission to a file or folder and returns its link.
| Setting | Required | What it does |
|---|---|---|
resource_id | Yes | The file or folder id, such as "{{ steps.folder.id }}". |
permission_type | Yes | anyone_with_link, user, group or domain. |
role | Yes | reader, commenter or writer. |
email | For user and group | The address to share with. |
domain | For domain | The Google Workspace domain. |
Output: permission_id, type, role, shareable_url.
Errors
Section titled “Errors”| Code | Usual cause |
|---|---|
credential_not_configured | The Drive credential is not stored. |
credential_unreadable | It is stored but cannot be decrypted, usually after the site’s security keys changed. Store it again. |
config_error | A required setting is empty, or the stored JSON has no client_email. |
auth_failed | Google answered 401 or 403: the folder is not shared with the service account, or the quota error above. |
external_4xx | Another refusal, such as a folder id that does not exist. |
rate_limited, external_5xx | Google is limiting or failing requests. |