Skip to content
Proud to collaborate with Microsoft for Startups

cloudflare.r2.upload_assets ​

Upload static assets to R2 bucket

Uploads static assets to a Cloudflare R2 bucket.

This is used for SPA deployment where static files (HTML, CSS, JS, images) are uploaded to R2 for serving via Workers or direct access.

Inputs:

  • bucket_name: Name of the R2 bucket (required).
  • assets: List of asset objects with 'key' and 'content' (required). Each asset:
  • connection_uuid: Cloud connection UUID for Cloudflare credentials (required).

Outputs (terminal state_data):

  • bucket_name: str — confirmed bucket name
  • file_count: int — number of files uploaded

Compensation: Use cloudflare.r2.delete_objects to remove uploaded files. Plugin required: context.get_plugin("cloudflare")

Overview ​

PropertyValue
Workflow typeAtomic
LibraryApp-cloudflare
Version1.0

Input Schema ​

FieldTypeRequiredDefaultDescription
bucket_namestringYes—Name of the R2 bucket
assetslistYes—List of assets to upload [{key, content, content_type}, ...]
connection_uuiduuidYes—Cloud connection UUID for Cloudflare credentials

Output Schema ​

FieldTypeRequiredDefaultDescription
bucket_namestringNo——
file_countintegerNo——
assetslistNo——
connection_uuiduuidNo——
failure_reasonstringNo——
failure_typestringNo——
failed_actionstringNo——
failed_at_statestringNo——
failed_stepstringNo——
failed_layerstringNo——
errorstringNo——
error_typestringNo——

States ​

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

State Diagram ​

Transitions ​

FromActionToDescription
pendingexecutecompleted—
* (any state)failfailed—

API Usage ​

bash
POST /api/workflows/start
Content-Type: application/json

{
  "workflow_type": "cloudflare.r2.upload_assets",
  "initial_data": {
    "bucket_name": "value",
    "assets": "value",
    "connection_uuid": "value"
  }
}