Google Drive - Upload Files from Workflows
Overview
Easily import one or more files directly into a Google Drive account. The match type selected greatly affects how this Template works.
Note: This Template cannot be used to upload a local file from your computer.
Recommended Setup:
- A Task built with this Template should typically run after a Task that either downloads a file to Workflows or generates a file with code.
- This Template supports providing either the name of the Folder/Shared Drive or the ID itself. The ID is the recommended approach because it is unique and can be copied from the URL, see the authorization guide for details.
- Service accounts may not be able to upload to a folder and must use a Shared Drive https://support.google.com/a/users/answer/7212025?hl=en
Variables
| Name | Reference | Type | Required | Default | Options | Description |
|---|---|---|---|---|---|---|
| Workflows File Name | DRIVE_SOURCE_FILE_NAME | Alphanumeric | ✅ | None | - | Name of the target file on Workflows. Can be regex if "Match Type" is set accordingly. |
| Workflows File Name Match Type | DRIVE_SOURCE_FILE_NAME_MATCH_TYPE | Select | ✅ | exact_match | Exact Match: exact_match Regex Match: regex_match | Determines if the text in "Workflows File Name" will look for one file with exact match, or multiple files using regex. |
| Workflows Folder Name | DRIVE_SOURCE_FOLDER_NAME | Alphanumeric | ➖ | None | - | Name of the local folder on Workflows to upload the target file from. If left blank, will look in the home directory. |
| Shared Drive Name/ID | DRIVE_SHARED_DRIVE_NAME | Alphanumeric | ➖ | None | - | Name of the Shared Drive the file exists in. This field is case sensitive. Leave blank if the file does not exist in a Shared Drive. |
| Google Drive Folder Name/ID | DRIVE_DESTINATION_FOLDER_NAME | Alphanumeric | ➖ | None | - | Folder where the file(s) should be uploaded. Leaving blank will place the file in the root directory of Google Drive which will be inaccessible in the UI. |
| Google Drive File Name | DRIVE_DESTINATION_FILE_NAME | Alphanumeric | ➖ | None | - | What to name the file(s) being uploaded. If left blank, defaults to the original file name(s). |
YAML
Below is the YAML template
source:
template: Google Drive - Upload Files from Workflows
inputs:
DRIVE_SOURCE_FILE_NAME:
DRIVE_SOURCE_FILE_NAME_MATCH_TYPE: exact_match
DRIVE_SOURCE_FOLDER_NAME:
DRIVE_SHARED_DRIVE_NAME:
DRIVE_DESTINATION_FOLDER_NAME:
DRIVE_DESTINATION_FILE_NAME:
type: TEMPLATE
guardrails:
retry_count: 1
retry_wait: 0h0m0s
runtime_cutoff: 1h0m0s
exclude_exit_code_ranges:
- 202
- 203
- 204
- 205
- 206
- 207
- 208
- 209
- 210
- 249