Google Workspace Upload

Google Workspace Upload

Certified

Upload a file to Drive

Uploads from Kestra storage to Drive using a service account. Creates or updates depending on fileId. Supports converting content by setting mimeType to a Google type. File size for Google apps is taken from the uploaded content.

yaml
type: io.kestra.plugin.googleworkspace.drive.Upload

Upload a csv and convert it to sheet format

yaml
id: googleworkspace_drive_upload
namespace: company.team

inputs:
  - id: file
    type: FILE
    description: The file to be uploaded to Google Drive

tasks:
  - id: upload
    type: io.kestra.plugin.googleworkspace.drive.Upload
    from: "{{ inputs.file }}"
    parents:
     - "1HuxzpLt1b0111MuKMgy8wAv-m9Myc1E_"
    name: "My awesome CSV"
    contentType: "text/csv"
    mimeType: "application/vnd.google-apps.spreadsheet"

Upload file to Google Drive

yaml
id: upload_google_drive
namespace: company.team

tasks:
  - id: download
    type: io.kestra.plugin.core.http.Download
    uri: https://huggingface.co/datasets/kestra/datasets/raw/main/csv/orders.csv

  - id: upload
    type: io.kestra.plugin.googleworkspace.drive.Upload
    from: "{{ outputs.download.uri }}"
    parents:
      - 15OENbAxvonlASDkYyfGBftV2c0fDTmnB
    name: Orders
    contentType: text/csv
    mimeType: application/vnd.google-apps.spreadsheet
Properties

Content type

RFC2045 content type of the uploaded data (e.g., text/csv, application/pdf)

Source file URI

kestra:// URI of the file to upload

File description

Optional short description; supports templating

Existing file ID

When set, updates that file; otherwise a new file is created

MIME type

Explicit MIME type; Drive auto-detects if omitted. Google MIME types import content when possible. Supported import formats: https://developers.google.com/drive/api/v3/mime-types

File name

Display name; not necessarily unique inside a folder

SubTypestring

Destination folders

Parent folder IDs; leave empty for My Drive root

Reference (ref) of the pluginDefaults to apply to this task.

Default120

The read timeout for the request (in seconds)

SubTypestring
Default["https://www.googleapis.com/auth/drive"]

The GCP scopes to used

The GCP service account key

Shared Drive ID

Target Shared Drive (teamDriveId) when writing outside My Drive

Uploaded file metadata

Definitions
createdTimestring
Formatdate-time
idstring
mimeTypestring
namestring
parentsarray
SubTypestring
sizeinteger
trashedboolean
versioninteger
Unitcount

Number of files returned by the list query