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 ​
| Property | Value |
|---|---|
| Workflow type | Atomic |
| Library | App-cloudflare |
| Version | 1.0 |
Input Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
script_name | string | Yes | — | Name of the worker script |
script_content | string | Yes | — | JavaScript/TypeScript code for the worker |
connection_uuid | uuid | Yes | — | Cloud connection UUID for Cloudflare credentials |
Output Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
script_id | string | No | — | — |
script_name | string | No | — | — |
worker_url | string | No | — | — |
connection_uuid | uuid | No | — | — |
script_content | 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 | Create-script request accepted |
completed | No | Yes | Yes | — | Worker script created |
failed | No | Yes | No | — | Worker script creation failed |
State Diagram ​
Transitions ​
| From | Action | To | Description |
|---|---|---|---|
pending | execute | completed | Create worker script |
* (any state) | fail | failed | Mark 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"
}
}