Skip to content

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.

Looks up a folder inside a parent folder. Read-only.

SettingRequiredWhat it doesDefault
parent_idYesThe folder to look in.—
nameYesThe folder name.—
exact_matchNoFalse 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.

Returns the folder with that name in the parent, creating it if there is none. Safe to run twice.

SettingRequiredWhat it does
parent_idYesThe parent folder.
nameYesThe folder name, for example "{{ labels.company }} — {{ now('Y-m') }}".

Output: id, name, web_view_link, was_created.

Creates a folder.

SettingRequiredWhat it doesDefault
parent_idYesThe parent folder.—
nameYesThe folder name.—
allow_duplicateNoCreate a new folder even when one with this name exists. Otherwise the existing folder is returned.false

Output: id, name, web_view_link.

Uploads the file from one of the entry’s file fields. Files over 5 MB are sent in 8 MB parts.

SettingRequiredWhat it doesDefault
parent_idYesThe folder to upload into.—
file_fieldYesThe form’s file field key.—
rename_toNoA 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.

Creates a file from text, such as a submission summary.

SettingRequiredWhat it doesDefault
parent_idYesThe folder.—
nameYesThe file name with extension, such as summary.md.—
contentYesThe text. At most 1 MB.—
mime_typeNoFor 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.

Adds a sharing permission to a file or folder and returns its link.

SettingRequiredWhat it does
resource_idYesThe file or folder id, such as "{{ steps.folder.id }}".
permission_typeYesanyone_with_link, user, group or domain.
roleYesreader, commenter or writer.
emailFor user and groupThe address to share with.
domainFor domainThe Google Workspace domain.

Output: permission_id, type, role, shareable_url.

CodeUsual cause
credential_not_configuredThe Drive credential is not stored.
credential_unreadableIt is stored but cannot be decrypted, usually after the site’s security keys changed. Store it again.
config_errorA required setting is empty, or the stored JSON has no client_email.
auth_failedGoogle answered 401 or 403: the folder is not shared with the service account, or the quota error above.
external_4xxAnother refusal, such as a folder id that does not exist.
rate_limited, external_5xxGoogle is limiting or failing requests.