
Google Drive Upload
CertifiedUpload a file to Drive
Google Drive Upload
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.
type: io.kestra.plugin.googleworkspace.drive.UploadExamples
Upload a csv and convert it to sheet format
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
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
contentType *string
Content type
RFC2045 content type of the uploaded data (e.g., text/csv, application/pdf)
from *string
Source file URI
kestra:// URI of the file to upload
assets
Assets this task consumes as inputs or produces as outputs, for lineage tracking and the asset graph (Enterprise Edition). A flow declaring this property on a task is rejected in the open-source edition.
io.kestra.core.models.assets.AssetsDeclaration
IGNOREFAILWARNAsset failure behavior
Behavior applied to the task state when a declared asset fails to render, emit, or be persisted (e.g. a lock conflict): FAIL escalates it to FAILED, WARN (default) warns it if it would otherwise succeed, IGNORE leaves the state untouched.
Whether to auto-register assets referenced dynamically at runtime that are not statically declared in inputs or outputs.
The assets consumed as inputs.
io.kestra.core.models.assets.AssetIdentifier
1The assets produced as outputs.
io.kestra.plugin.ee.assets.Dataset
1150{}1150io.kestra.plugin.ee.assets.File
1150{}1150io.kestra.plugin.ee.assets.Table
1150{}1150io.kestra.plugin.ee.assets.VM
1150{}1150io.kestra.core.models.assets.External
1150{}1150io.kestra.core.models.assets.Custom
11501Custom asset type
{}1150description string
File description
Optional short description; supports templating
fileId string
Existing file ID
When set, updates that file; otherwise a new file is created
mimeType string
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
name string
File name
Display name; not necessarily unique inside a folder
parents array
Destination folders
Parent folder IDs; leave empty for My Drive root
readTimeout integerstring
120The read timeout for the request (in seconds)
scopes array
["https://www.googleapis.com/auth/drive"]The GCP scopes to used
serviceAccount string
The GCP service account key
teamDriveId string
Shared Drive ID
Target Shared Drive (teamDriveId) when writing outside My Drive
Outputs
file
Uploaded file metadata
io.kestra.plugin.googleworkspace.drive.models.File
date-timeMetrics
size counter
countNumber of files returned by the list query