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 ​
| Property | Value |
|---|---|
| Workflow type | Atomic |
| Library | Base |
| Version | 1.0 |
Input Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
bucket_name | string | Yes | — | GCS bucket name |
object_name | string | Yes | — | Object name in bucket |
source_path | string | No | — | Local file path to upload |
content | string | No | — | Content to upload |
content_type | string | No | — | MIME type (default: application/octet-stream) |
metadata | json | No | — | Custom metadata dict |
connection_uuid | uuid | No | — | Cloud connection UUID for GCP credentials |
Output Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
bucket_name | string | No | — | — |
content_type | string | No | — | — |
object_name | string | No | — | — |
object_url | string | No | — | — |
size_bytes | integer | No | — | — |
connection_uuid | uuid | No | — | — |
content | string | No | — | — |
metadata | json | No | — | — |
source_path | string | No | — | — |
failure_reason | string | No | — | — |
failure_type | string | No | — | — |
failed_action | string | No | — | — |
failed_at_state | string | No | — | — |
failed_step | string | No | — | — |
failed_layer | string | No | — | — |
error | string | No | — | — |
error_type | string | No | — | — |
States ​
| State | Initial | Terminal | Success | Auto-advance | Description |
|---|---|---|---|---|---|
pending | Yes | No | — | execute | — |
completed | No | Yes | Yes | — | — |
failed | No | Yes | No | — | — |
Transitions ​
| From | Action | To | Description |
|---|---|---|---|
pending | execute | completed | — |
* (any state) | fail | failed | — |
API Usage ​
bash
POST /api/v1/workflows/gcp.storage.upload_object/start
Content-Type: application/json
{ ... input fields ... }