Skip to content
Proud to collaborate with Microsoft for Startups

gcp.storage.upload_object ​

Upload an object to GCS bucket

Uploads an object to a Google Cloud Storage (GCS) bucket.

The object can be uploaded from a local file path or directly from content. Supports setting custom metadata and content type.

Inputs:

  • bucket_name: Name of the GCS bucket (required).
  • object_name: Name of the object in the bucket (required).
  • source_path: Local file path to upload (required if content not provided).
  • content: Content to upload as string/bytes (required if source_path not provided).
  • content_type: MIME type of the object (optional, default: application/octet-stream).
  • metadata: Custom metadata as dict (optional).
  • connection_uuid: Cloud connection UUID for GCP credentials.

Outputs (terminal state_data):

  • bucket_name: str — bucket name
  • object_name: str — object name in bucket
  • object_url: str — GCS object URL, e.g. gs://bucket/path/to/object
  • size_bytes: int — size of uploaded object
  • content_type: str — content type of the object

Compensation: Use gcp.storage.delete_object to undo. Plugin required: context.get_plugin("gcp") must expose .get_storage_client().

Overview ​

PropertyValue
Workflow typeAtomic
LibraryBase
Version1.0

Input Schema ​

FieldTypeRequiredDefaultDescription
bucket_namestringYes—GCS bucket name
object_namestringYes—Object name in bucket
source_pathstringNo—Local file path to upload
contentstringNo—Content to upload
content_typestringNo—MIME type (default: application/octet-stream)
metadatajsonNo—Custom metadata dict
connection_uuiduuidNo—Cloud connection UUID for GCP credentials

Output Schema ​

FieldTypeRequiredDefaultDescription
bucket_namestringNo——
content_typestringNo——
object_namestringNo——
object_urlstringNo——
size_bytesintegerNo——
connection_uuiduuidNo——
contentstringNo——
metadatajsonNo——
source_pathstringNo——
failure_reasonstringNo——
failure_typestringNo——
failed_actionstringNo——
failed_at_statestringNo——
failed_stepstringNo——
failed_layerstringNo——
errorstringNo——
error_typestringNo——

States ​

StateInitialTerminalSuccessAuto-advanceDescription
pendingYesNo—execute—
completedNoYesYes——
failedNoYesNo——

Transitions ​

FromActionToDescription
pendingexecutecompleted—
* (any state)failfailed—

API Usage ​

bash
POST /api/v1/workflows/gcp.storage.upload_object/start
Content-Type: application/json

{ ... input fields ... }