Skip to content
Proud to collaborate with Microsoft for Startups

cloudflare.workers.create_script ​

Create a Cloudflare Worker script

Creates a Cloudflare Worker script.

The worker is created with the provided JavaScript/TypeScript code. If a worker with the same name already exists, it will be updated.

Inputs:

  • script_name: Name of the worker script (required). Must be unique within the account.
  • script_content: JavaScript/TypeScript code for the worker (required).
  • connection_uuid: Cloud connection UUID for Cloudflare credentials (required).

Outputs (terminal state_data):

  • script_name: str — confirmed script name
  • script_id: str — worker script ID
  • worker_url: str — URL to access the deployed worker

Compensation: Use cloudflare.workers.delete_script to undo. Plugin required: context.get_plugin("cloudflare")

Overview ​

PropertyValue
Workflow typeAtomic
LibraryApp-cloudflare
Version1.0

Input Schema ​

FieldTypeRequiredDefaultDescription
script_namestringYes—Name of the worker script
script_contentstringYes—JavaScript/TypeScript code for the worker
connection_uuiduuidYes—Cloud connection UUID for Cloudflare credentials

Output Schema ​

FieldTypeRequiredDefaultDescription
script_idstringNo——
script_namestringNo——
worker_urlstringNo——
connection_uuiduuidNo——
script_contentstringNo——
failure_reasonstringNo——
failure_typestringNo——
failed_actionstringNo——
failed_at_statestringNo——
failed_stepstringNo——
failed_layerstringNo——
errorstringNo——
error_typestringNo——

States ​

StateInitialTerminalSuccessAuto-advanceDescription
pendingYesNo—executeCreate-script request accepted
completedNoYesYes—Worker script created
failedNoYesNo—Worker script creation failed

State Diagram ​

Transitions ​

FromActionToDescription
pendingexecutecompletedCreate worker script
* (any state)failfailedMark workflow failed

API Usage ​

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

{
  "workflow_type": "cloudflare.workers.create_script",
  "initial_data": {
    "script_name": "value",
    "script_content": "value",
    "connection_uuid": "value"
  }
}