Skip to content
Start here

Dispatch

DispatchNamespaces

List dispatch namespaces
workers_for_platforms.dispatch.namespaces.list(NamespaceListParams**kwargs) -> SyncSinglePage[NamespaceListResponse]
GET/accounts/{account_id}/workers/dispatch/namespaces
Get dispatch namespace
workers_for_platforms.dispatch.namespaces.get(strdispatch_namespace, NamespaceGetParams**kwargs) -> NamespaceGetResponse
GET/accounts/{account_id}/workers/dispatch/namespaces/{dispatch_namespace}
Create dispatch namespace
workers_for_platforms.dispatch.namespaces.create(NamespaceCreateParams**kwargs) -> NamespaceCreateResponse
POST/accounts/{account_id}/workers/dispatch/namespaces
Delete dispatch namespace
workers_for_platforms.dispatch.namespaces.delete(strdispatch_namespace, NamespaceDeleteParams**kwargs) -> object
DELETE/accounts/{account_id}/workers/dispatch/namespaces/{dispatch_namespace}
ModelsExpand Collapse
class NamespaceListResponse:
created_by: Optional[str]

Identifier.

maxLength32
created_on: Optional[datetime]

When the script was created.

formatdate-time
modified_by: Optional[str]

Identifier.

maxLength32
modified_on: Optional[datetime]

When the script was last modified.

formatdate-time
namespace_id: Optional[str]

API Resource UUID tag.

maxLength36
namespace_name: Optional[str]

Name of the Workers for Platforms dispatch namespace.

script_count: Optional[int]

The current number of scripts in this Dispatch Namespace.

trusted_workers: Optional[bool]

Whether the Workers in the namespace are executed in a “trusted” manner. When a Worker is trusted, it has access to the shared caches for the zone in the Cache API, and has access to the request.cf object on incoming Requests. When a Worker is untrusted, caches are not shared across the zone, and request.cf is undefined. By default, Workers in a namespace are “untrusted”.

class NamespaceGetResponse:
created_by: Optional[str]

Identifier.

maxLength32
created_on: Optional[datetime]

When the script was created.

formatdate-time
modified_by: Optional[str]

Identifier.

maxLength32
modified_on: Optional[datetime]

When the script was last modified.

formatdate-time
namespace_id: Optional[str]

API Resource UUID tag.

maxLength36
namespace_name: Optional[str]

Name of the Workers for Platforms dispatch namespace.

script_count: Optional[int]

The current number of scripts in this Dispatch Namespace.

trusted_workers: Optional[bool]

Whether the Workers in the namespace are executed in a “trusted” manner. When a Worker is trusted, it has access to the shared caches for the zone in the Cache API, and has access to the request.cf object on incoming Requests. When a Worker is untrusted, caches are not shared across the zone, and request.cf is undefined. By default, Workers in a namespace are “untrusted”.

class NamespaceCreateResponse:
created_by: Optional[str]

Identifier.

maxLength32
created_on: Optional[datetime]

When the script was created.

formatdate-time
modified_by: Optional[str]

Identifier.

maxLength32
modified_on: Optional[datetime]

When the script was last modified.

formatdate-time
namespace_id: Optional[str]

API Resource UUID tag.

maxLength36
namespace_name: Optional[str]

Name of the Workers for Platforms dispatch namespace.

script_count: Optional[int]

The current number of scripts in this Dispatch Namespace.

trusted_workers: Optional[bool]

Whether the Workers in the namespace are executed in a “trusted” manner. When a Worker is trusted, it has access to the shared caches for the zone in the Cache API, and has access to the request.cf object on incoming Requests. When a Worker is untrusted, caches are not shared across the zone, and request.cf is undefined. By default, Workers in a namespace are “untrusted”.

DispatchNamespacesScripts

Worker Details
workers_for_platforms.dispatch.namespaces.scripts.get(strscript_name, ScriptGetParams**kwargs) -> Script
GET/accounts/{account_id}/workers/dispatch/namespaces/{dispatch_namespace}/scripts/{script_name}
Upload Worker Module
workers_for_platforms.dispatch.namespaces.scripts.update(strscript_name, ScriptUpdateParams**kwargs) -> ScriptUpdateResponse
PUT/accounts/{account_id}/workers/dispatch/namespaces/{dispatch_namespace}/scripts/{script_name}
Delete Worker
workers_for_platforms.dispatch.namespaces.scripts.delete(strscript_name, ScriptDeleteParams**kwargs) -> object
DELETE/accounts/{account_id}/workers/dispatch/namespaces/{dispatch_namespace}/scripts/{script_name}
ModelsExpand Collapse
class Script:

Details about a worker uploaded to a Workers for Platforms namespace.

created_on: Optional[datetime]

When the script was created.

formatdate-time
dispatch_namespace: Optional[str]

Name of the Workers for Platforms dispatch namespace.

modified_on: Optional[datetime]

When the script was last modified.

formatdate-time
script: Optional[Script]
class ScriptUpdateResponse:
startup_time_ms: int
id: Optional[str]

The name used to identify the script.

cache_options: Optional[CacheOptions]

Global CacheW configuration for the Worker. When caching is on, the platform provisions a cloudflare.app zone for the Worker. A type: worker entry in the exports map can override this value for a single entrypoint.

enabled: bool

Whether caching is enabled for this Worker.

cross_version_cache: Optional[bool]

Whether cached responses are shared across Worker version uploads. This is independent of enabled. It can stay true while caching is off, so the preference survives turning caching off and back on.

compatibility_date: Optional[str]

Date indicating targeted support in the Workers runtime. Backwards incompatible fixes to the runtime following this date will not affect this Worker.

compatibility_flags: Optional[List[str]]

Flags that enable or disable certain features in the Workers runtime. Used to enable upcoming features or opt in or out of specific changes not included in a compatibility_date.

created_on: Optional[datetime]

When the script was created.

formatdate-time
entry_point: Optional[str]

The entry point for the script.

etag: Optional[str]

Hashed script content, can be used in a If-None-Match header when updating.

exports: Optional[Dict[str, Exports]]

Declarative exports for the Worker’s most recent version, including Durable Object classes (with their storage backend) and named Worker entrypoints. Tombstoned lifecycle entries are omitted, so only live exports (created and expecting-transfer) are returned.

One of the following:
class ExportsWorkersWorkerExport:

A named Worker entrypoint export (type: worker). Worker entrypoints are always live (state: created) and carry no storage or lifecycle fields. The optional cache block overrides the Worker’s global cache_options.enabled for this entrypoint.

type: Literal["worker"]

Marks this entry as a Worker entrypoint export.

cache: Optional[ExportsWorkersWorkerExportCache]

Cache override for this entrypoint. Overrides the Worker’s global cache_options.enabled for this entrypoint only.

enabled: bool

Whether caching is enabled for this entrypoint.

state: Optional[Literal["created"]]

Live export. May be omitted; defaults to created.

class ExportsWorkersDurableObjectExport:

A live Durable Object export (state: created, the default). The platform auto-provisions the namespace on first deploy, matches it on subsequent deploys, and never mutates or deletes it as a side effect of a code-only change. storage is required; renamed_to, transferred_to and transfer_from are not allowed on a live entry.

storage: Literal["sqlite", "legacy-kv"]

Durable Object storage backend. sqlite is the recommended (and only) backend for new namespaces. legacy-kv is accepted only for a class whose namespace already exists as KV-backed; the exports flow never provisions a new legacy-kv namespace.

One of the following:
"sqlite"
"legacy-kv"
type: Literal["durable-object"]

Marks this entry as a Durable Object export.

container: Optional[str]

Name of the container (declared in the upload’s metadata.containers) that backs this Durable Object. When set, the namespace is container-enabled. Valid only on live entries.

maxLength128
state: Optional[Literal["created"]]

Live export. May be omitted; defaults to created.

class ExportsWorkersDurableObjectDeletedExport:

A deleted tombstone: retires the provisioned namespace for this class and all of its data. The class must be absent from the uploaded code and no other Worker in the account may bind to the namespace, otherwise the deploy is rejected. No other fields are allowed. Deletion is irreversible.

state: Literal["deleted"]

Tombstone that deletes the namespace.

type: Literal["durable-object"]

Marks this entry as a Durable Object export.

class ExportsWorkersDurableObjectRenamedExport:

A renamed tombstone: rewrites the provisioned namespace’s class name from this map key to renamed_to. The source class may stay in code during the rollout window (an info notice is emitted). storage, transferred_to and transfer_from are not allowed.

renamed_to: str

The destination class name. Must differ from the source class (the map key) and must be declared as a live (created) entry in the same exports map. Write-only: never present in GET responses.

maxLength128
state: Literal["renamed"]

Tombstone that renames the namespace’s class.

type: Literal["durable-object"]

Marks this entry as a Durable Object export.

class ExportsWorkersDurableObjectTransferredExport:

A transferred tombstone (source side of a two-phase transfer): hands ownership of the provisioned namespace to another script in the same account, named by transferred_to. The target must have already deployed a matching expecting-transfer entry. The source class may stay in code during the rollout window (an info notice is emitted). storage, renamed_to and transfer_from are not allowed.

state: Literal["transferred"]

Tombstone that transfers the namespace to another script.

transferred_to: str

The destination script name. Must be in the same account and the same dispatch-namespace context (or both non-dispatch). Cross-dispatch-namespace transfers are rejected. Write-only: never present in GET responses.

maxLength128
type: Literal["durable-object"]

Marks this entry as a Durable Object export.

class ExportsWorkersDurableObjectExpectingTransferExport:

The target side of a two-phase transfer (state: expecting-transfer). Declares that this script expects to receive a namespace for this class from the transfer_from script. This is a live entry, not a tombstone: bindings resolve through the source’s namespace until the source commits with a transferred tombstone. storage and transfer_from are required; renamed_to and transferred_to are not allowed.

state: Literal["expecting-transfer"]

Target side of a two-phase transfer.

storage: Literal["sqlite", "legacy-kv"]

Durable Object storage backend. sqlite is the recommended (and only) backend for new namespaces. legacy-kv is accepted only for a class whose namespace already exists as KV-backed; the exports flow never provisions a new legacy-kv namespace.

One of the following:
"sqlite"
"legacy-kv"
transfer_from: str

The source script name to receive the namespace from. Must be in the same account and dispatch-namespace context. Present on reads for expecting-transfer entries.

maxLength128
type: Literal["durable-object"]

Marks this entry as a Durable Object export.

container: Optional[str]

Name of the container (declared in the upload’s metadata.containers) that backs this Durable Object once the transfer settles. Valid only on live entries.

maxLength128
handlers: Optional[List[str]]

The names of handlers exported as part of the default export.

has_assets: Optional[bool]

Whether a Worker contains assets.

has_modules: Optional[bool]

Whether a Worker contains modules.

last_deployed_from: Optional[str]

The client most recently used to deploy this Worker.

logpush: Optional[bool]

Whether Logpush is turned on for the Worker.

migration_tag: Optional[str]

The tag of the Durable Object migration that was most recently applied for this Worker.

modified_on: Optional[datetime]

When the script was last modified.

formatdate-time
named_handlers: Optional[List[NamedHandler]]

Named exports, such as Durable Object class implementations and named entrypoints.

handlers: Optional[List[str]]

The names of handlers exported as part of the named export.

name: Optional[str]

The name of the export.

observability: Optional[Observability]

Observability settings for the Worker.

enabled: bool

Whether observability is enabled for the Worker.

head_sampling_rate: Optional[float]

The sampling rate for incoming requests. From 0 to 1 (1 = 100%, 0.1 = 10%). Default is 1.

logs: Optional[ObservabilityLogs]

Log settings for the Worker.

enabled: bool

Whether logs are enabled for the Worker.

invocation_logs: bool

Whether invocation logs are enabled for the Worker.

destinations: Optional[List[str]]

A list of destinations where logs will be exported to.

head_sampling_rate: Optional[float]

The sampling rate for logs. From 0 to 1 (1 = 100%, 0.1 = 10%). Default is 1.

persist: Optional[bool]

Whether log persistence is enabled for the Worker.

traces: Optional[ObservabilityTraces]

Trace settings for the Worker.

destinations: Optional[List[str]]

A list of destinations where traces will be exported to.

enabled: Optional[bool]

Whether traces are enabled for the Worker.

head_sampling_rate: Optional[float]

The sampling rate for traces. From 0 to 1 (1 = 100%, 0.1 = 10%). Default is 1.

persist: Optional[bool]

Whether trace persistence is enabled for the Worker.

propagation_policy: Optional[Literal["authenticated", "accept"]]

Controls how inbound trace context (traceparent/tracestate) headers on incoming requests are handled. “authenticated” (default) honors inbound trace context only when accompanied by a valid trace auth token. “accept” unconditionally accepts inbound trace context. Requires the trace propagation feature to be enabled.

One of the following:
"authenticated"
"accept"
placement: Optional[Placement]

Configuration for Smart Placement. Specify mode=‘smart’ for Smart Placement, or one of region/hostname/host.

One of the following:
class PlacementUnionMember0:
mode: Literal["smart"]
last_analyzed_at: Optional[datetime]

The last time the script was analyzed for Smart Placement.

formatdate-time
status: Optional[Literal["SUCCESS", "UNSUPPORTED_APPLICATION", "INSUFFICIENT_INVOCATIONS"]]

Status of Smart Placement.

One of the following:
"SUCCESS"
"UNSUPPORTED_APPLICATION"
"INSUFFICIENT_INVOCATIONS"
class PlacementUnionMember1:
region: str

Cloud region for targeted placement in format ‘provider:region’.

last_analyzed_at: Optional[datetime]

The last time the script was analyzed for Smart Placement.

formatdate-time
status: Optional[Literal["SUCCESS", "UNSUPPORTED_APPLICATION", "INSUFFICIENT_INVOCATIONS"]]

Status of Smart Placement.

One of the following:
"SUCCESS"
"UNSUPPORTED_APPLICATION"
"INSUFFICIENT_INVOCATIONS"
class PlacementUnionMember2:
hostname: str

HTTP hostname for targeted placement.

last_analyzed_at: Optional[datetime]

The last time the script was analyzed for Smart Placement.

formatdate-time
status: Optional[Literal["SUCCESS", "UNSUPPORTED_APPLICATION", "INSUFFICIENT_INVOCATIONS"]]

Status of Smart Placement.

One of the following:
"SUCCESS"
"UNSUPPORTED_APPLICATION"
"INSUFFICIENT_INVOCATIONS"
class PlacementUnionMember3:
host: str

TCP host and port for targeted placement.

last_analyzed_at: Optional[datetime]

The last time the script was analyzed for Smart Placement.

formatdate-time
status: Optional[Literal["SUCCESS", "UNSUPPORTED_APPLICATION", "INSUFFICIENT_INVOCATIONS"]]

Status of Smart Placement.

One of the following:
"SUCCESS"
"UNSUPPORTED_APPLICATION"
"INSUFFICIENT_INVOCATIONS"
class PlacementUnionMember4:
mode: Literal["targeted"]

Targeted placement mode.

region: str

Cloud region for targeted placement in format ‘provider:region’.

last_analyzed_at: Optional[datetime]

The last time the script was analyzed for Smart Placement.

formatdate-time
status: Optional[Literal["SUCCESS", "UNSUPPORTED_APPLICATION", "INSUFFICIENT_INVOCATIONS"]]

Status of Smart Placement.

One of the following:
"SUCCESS"
"UNSUPPORTED_APPLICATION"
"INSUFFICIENT_INVOCATIONS"
class PlacementUnionMember5:
hostname: str

HTTP hostname for targeted placement.

mode: Literal["targeted"]

Targeted placement mode.

last_analyzed_at: Optional[datetime]

The last time the script was analyzed for Smart Placement.

formatdate-time
status: Optional[Literal["SUCCESS", "UNSUPPORTED_APPLICATION", "INSUFFICIENT_INVOCATIONS"]]

Status of Smart Placement.

One of the following:
"SUCCESS"
"UNSUPPORTED_APPLICATION"
"INSUFFICIENT_INVOCATIONS"
class PlacementUnionMember6:
host: str

TCP host and port for targeted placement.

mode: Literal["targeted"]

Targeted placement mode.

last_analyzed_at: Optional[datetime]

The last time the script was analyzed for Smart Placement.

formatdate-time
status: Optional[Literal["SUCCESS", "UNSUPPORTED_APPLICATION", "INSUFFICIENT_INVOCATIONS"]]

Status of Smart Placement.

One of the following:
"SUCCESS"
"UNSUPPORTED_APPLICATION"
"INSUFFICIENT_INVOCATIONS"
class PlacementUnionMember7:
mode: Literal["targeted"]

Targeted placement mode.

target: List[PlacementUnionMember7Target]

Array of placement targets (currently limited to single target).

One of the following:
class PlacementUnionMember7TargetRegion:
region: str

Cloud region in format ‘provider:region’.

class PlacementUnionMember7TargetHostname:
hostname: str

HTTP hostname for targeted placement.

class PlacementUnionMember7TargetHost:
host: str

TCP host:port for targeted placement.

last_analyzed_at: Optional[datetime]

The last time the script was analyzed for Smart Placement.

formatdate-time
status: Optional[Literal["SUCCESS", "UNSUPPORTED_APPLICATION", "INSUFFICIENT_INVOCATIONS"]]

Status of Smart Placement.

One of the following:
"SUCCESS"
"UNSUPPORTED_APPLICATION"
"INSUFFICIENT_INVOCATIONS"
Deprecatedplacement_mode: Optional[Literal["smart", "targeted"]]
One of the following:
"smart"
"targeted"
Deprecatedplacement_status: Optional[Literal["SUCCESS", "UNSUPPORTED_APPLICATION", "INSUFFICIENT_INVOCATIONS"]]
One of the following:
"SUCCESS"
"UNSUPPORTED_APPLICATION"
"INSUFFICIENT_INVOCATIONS"
tag: Optional[str]

The immutable ID of the script.

tags: Optional[List[str]]

Tags associated with the Worker.

tail_consumers: Optional[List[ConsumerScript]]

List of Workers that will consume logs from the attached Worker.

service: str

Name of Worker that is to be the consumer.

environment: Optional[str]

Optional environment if the Worker utilizes one.

namespace: Optional[str]

Optional dispatch namespace the script belongs to.

usage_model: Optional[Literal["standard", "bundled", "unbound"]]

Usage model for the Worker invocations.

One of the following:
"standard"
"bundled"
"unbound"

DispatchNamespacesScriptsAsset Upload

Create Assets Upload Session
workers_for_platforms.dispatch.namespaces.scripts.asset_upload.create(strscript_name, AssetUploadCreateParams**kwargs) -> AssetUploadCreateResponse
POST/accounts/{account_id}/workers/dispatch/namespaces/{dispatch_namespace}/scripts/{script_name}/assets-upload-session
ModelsExpand Collapse
class AssetUploadCreateResponse:
buckets: Optional[List[List[str]]]

The requests to make to upload assets.

jwt: Optional[str]

A JWT to use as authentication for uploading assets.

DispatchNamespacesScriptsContent

Get Script Content
workers_for_platforms.dispatch.namespaces.scripts.content.get(strscript_name, ContentGetParams**kwargs) -> BinaryResponseContent
GET/accounts/{account_id}/workers/dispatch/namespaces/{dispatch_namespace}/scripts/{script_name}/content
Put Script Content
workers_for_platforms.dispatch.namespaces.scripts.content.update(strscript_name, ContentUpdateParams**kwargs) -> Script
PUT/accounts/{account_id}/workers/dispatch/namespaces/{dispatch_namespace}/scripts/{script_name}/content

DispatchNamespacesScriptsSettings

Get Script Settings
workers_for_platforms.dispatch.namespaces.scripts.settings.get(strscript_name, SettingGetParams**kwargs) -> SettingGetResponse
GET/accounts/{account_id}/workers/dispatch/namespaces/{dispatch_namespace}/scripts/{script_name}/settings
Patch Script Settings
workers_for_platforms.dispatch.namespaces.scripts.settings.edit(strscript_name, SettingEditParams**kwargs) -> SettingEditResponse
PATCH/accounts/{account_id}/workers/dispatch/namespaces/{dispatch_namespace}/scripts/{script_name}/settings
ModelsExpand Collapse
class SettingGetResponse:

Script and version settings for Workers for Platforms namespace scripts. Same as script-and-version-settings-item but without annotations, which are not supported for namespace scripts.

bindings: Optional[List[Binding]]

List of bindings attached to a Worker. You can find more about bindings on our docs: https://developers.cloudflare.com/workers/configuration/multipart-upload-metadata/#bindings.

One of the following:
class BindingWorkersBindingKindAI:
name: str

A JavaScript variable name for the binding.

type: Literal["ai"]

The kind of resource that the binding provides.

class BindingWorkersBindingKindAISearch:
instance_name: str

The user-chosen instance name. Must exist at deploy time. The worker can search, chat, update, and manage items/jobs on this instance.

name: str

A JavaScript variable name for the binding.

type: Literal["ai_search"]

The kind of resource that the binding provides.

namespace: Optional[str]

The namespace the instance belongs to. Defaults to “default” if omitted. Customers who don’t use namespaces can simply omit this field.

class BindingWorkersBindingKindAISearchNamespace:
name: str

A JavaScript variable name for the binding.

namespace: str

The user-chosen namespace name. Must exist before deploy — Wrangler handles auto-creation on deploy failure (R2 bucket pattern). The “default” namespace is auto-created by config-api for new accounts. Grants full access (CRUD + search + chat) to all instances within the namespace.

type: Literal["ai_search_namespace"]

The kind of resource that the binding provides.

class BindingWorkersBindingKindAnalyticsEngine:
dataset: str

The name of the dataset to bind to.

name: str

A JavaScript variable name for the binding.

type: Literal["analytics_engine"]

The kind of resource that the binding provides.

class BindingWorkersBindingKindAssets:
name: str

A JavaScript variable name for the binding.

type: Literal["assets"]

The kind of resource that the binding provides.

class BindingWorkersBindingKindBrowser:
name: str

A JavaScript variable name for the binding.

type: Literal["browser"]

The kind of resource that the binding provides.

class BindingWorkersBindingKindD1:
database_id: str

Identifier of the D1 database to bind to.

name: str

A JavaScript variable name for the binding.

type: Literal["d1"]

The kind of resource that the binding provides.

Deprecatedid: Optional[str]

This property has been renamed to database_id.

Identifier of the D1 database to bind to.

class BindingWorkersBindingKindDataBlob:
name: str

A JavaScript variable name for the binding.

part: str

The name of the file containing the data content. Only accepted for service worker syntax Workers.

Deprecatedtype: Literal["data_blob"]

The kind of resource that the binding provides.

class BindingWorkersBindingKindDispatchNamespace:
name: str

A JavaScript variable name for the binding.

namespace: str

The name of the dispatch namespace.

type: Literal["dispatch_namespace"]

The kind of resource that the binding provides.

outbound: Optional[BindingWorkersBindingKindDispatchNamespaceOutbound]

Outbound worker.

params: Optional[List[BindingWorkersBindingKindDispatchNamespaceOutboundParam]]

Pass information from the Dispatch Worker to the Outbound Worker through the parameters.

name: str

Name of the parameter.

worker: Optional[BindingWorkersBindingKindDispatchNamespaceOutboundWorker]

Outbound worker.

entrypoint: Optional[str]

Entrypoint to invoke on the outbound worker.

environment: Optional[str]

Environment of the outbound worker.

service: Optional[str]

Name of the outbound worker.

class BindingWorkersBindingKindDurableObjectNamespace:
name: str

A JavaScript variable name for the binding.

type: Literal["durable_object_namespace"]

The kind of resource that the binding provides.

class_name: Optional[str]

The exported class name of the Durable Object.

dispatch_namespace: Optional[str]

The dispatch namespace the Durable Object script belongs to.

environment: Optional[str]

The environment of the script_name to bind to.

namespace_id: Optional[str]

Namespace identifier tag.

maxLength32
script_name: Optional[str]

The script where the Durable Object is defined, if it is external to this Worker.

class BindingWorkersBindingKindHyperdrive:
id: str

Identifier of the Hyperdrive connection to bind to.

name: str

A JavaScript variable name for the binding.

type: Literal["hyperdrive"]

The kind of resource that the binding provides.

class BindingWorkersBindingKindInherit:
name: str

The name of the inherited binding.

type: Literal["inherit"]

The kind of resource that the binding provides.

old_name: Optional[str]

The old name of the inherited binding. If set, the binding will be renamed from old_name to name in the new version. If not set, the binding will keep the same name between versions.

version_id: Optional[str]

Identifier for the version to inherit the binding from, which can be the version ID or the literal “latest” to inherit from the latest version. Defaults to inheriting the binding from the latest version.

class BindingWorkersBindingKindImages:
name: str

A JavaScript variable name for the binding.

type: Literal["images"]

The kind of resource that the binding provides.

class BindingWorkersBindingKindJson:
json: object

JSON data to use.

name: str

A JavaScript variable name for the binding.

type: Literal["json"]

The kind of resource that the binding provides.

class BindingWorkersBindingKindKVNamespace:
name: str

A JavaScript variable name for the binding.

namespace_id: str

Namespace identifier tag.

maxLength32
type: Literal["kv_namespace"]

The kind of resource that the binding provides.

class BindingWorkersBindingKindMedia:
name: str

A JavaScript variable name for the binding.

type: Literal["media"]

The kind of resource that the binding provides.

class BindingWorkersBindingKindMTLSCertificate:
certificate_id: str

Identifier of the certificate to bind to.

name: str

A JavaScript variable name for the binding.

type: Literal["mtls_certificate"]

The kind of resource that the binding provides.

class BindingWorkersBindingKindPlainText:
name: str

A JavaScript variable name for the binding.

text: str

The text value to use.

type: Literal["plain_text"]

The kind of resource that the binding provides.

class BindingWorkersBindingKindPipelines:
name: str

A JavaScript variable name for the binding.

pipeline: str

Name of the Pipeline to bind to.

type: Literal["pipelines"]

The kind of resource that the binding provides.

class BindingWorkersBindingKindQueue:
name: str

A JavaScript variable name for the binding.

queue_name: str

Name of the Queue to bind to.

type: Literal["queue"]

The kind of resource that the binding provides.

class BindingWorkersBindingKindRatelimit:
name: str

A JavaScript variable name for the binding.

namespace_id: str

Identifier of the rate limit namespace to bind to.

simple: BindingWorkersBindingKindRatelimitSimple

The rate limit configuration.

limit: float

The limit (requests per period).

period: int

The period in seconds.

mitigation_timeout: Optional[int]

Duration in seconds to apply the mitigation action after the rate limit is exceeded. Valid values are 0 (disabled), 10, or multiples of 60 up to 86400. Must be greater than or equal to the period when non-zero.

type: Literal["ratelimit"]

The kind of resource that the binding provides.

class BindingWorkersBindingKindR2Bucket:
bucket_name: str

R2 bucket to bind to.

name: str

A JavaScript variable name for the binding.

type: Literal["r2_bucket"]

The kind of resource that the binding provides.

jurisdiction: Optional[Literal["eu", "fedramp", "fedramp-high"]]

The jurisdiction of the R2 bucket.

One of the following:
"eu"
"fedramp"
"fedramp-high"
class BindingWorkersBindingKindSecretText:
name: str

A JavaScript variable name for the binding.

text: str

The secret value to use.

type: Literal["secret_text"]

The kind of resource that the binding provides.

class BindingWorkersBindingKindSendEmail:
name: str

A JavaScript variable name for the binding.

type: Literal["send_email"]

The kind of resource that the binding provides.

allowed_destination_addresses: Optional[List[str]]

List of allowed destination addresses.

allowed_sender_addresses: Optional[List[str]]

List of allowed sender addresses.

destination_address: Optional[str]

Destination address for the email.

formatemail
class BindingWorkersBindingKindService:
name: str

A JavaScript variable name for the binding.

service: str

Name of Worker to bind to.

type: Literal["service"]

The kind of resource that the binding provides.

entrypoint: Optional[str]

Entrypoint to invoke on the target Worker.

environment: Optional[str]

Optional environment if the Worker utilizes one.

class BindingWorkersBindingKindTextBlob:
name: str

A JavaScript variable name for the binding.

part: str

The name of the file containing the text content. Only accepted for service worker syntax Workers.

Deprecatedtype: Literal["text_blob"]

The kind of resource that the binding provides.

class BindingWorkersBindingKindVectorize:
index_name: str

Name of the Vectorize index to bind to.

name: str

A JavaScript variable name for the binding.

type: Literal["vectorize"]

The kind of resource that the binding provides.

class BindingWorkersBindingKindVersionMetadata:
name: str

A JavaScript variable name for the binding.

type: Literal["version_metadata"]

The kind of resource that the binding provides.

class BindingWorkersBindingKindSecretsStoreSecret:
name: str

A JavaScript variable name for the binding.

secret_name: str

Name of the secret in the store.

store_id: str

ID of the store containing the secret.

type: Literal["secrets_store_secret"]

The kind of resource that the binding provides.

class BindingWorkersBindingKindFlagship:
app_id: str

ID of the Flagship app to bind to for feature flag evaluation.

maxLength128
name: str

A JavaScript variable name for the binding.

type: Literal["flagship"]

The kind of resource that the binding provides.

class BindingWorkersBindingKindSecretKey:
algorithm: object

Algorithm-specific key parameters. Learn more.

format: Literal["raw", "pkcs8", "spki", "jwk"]

Data format of the key. Learn more.

One of the following:
"raw"
"pkcs8"
"spki"
"jwk"
name: str

A JavaScript variable name for the binding.

type: Literal["secret_key"]

The kind of resource that the binding provides.

usages: List[Literal["encrypt", "decrypt", "sign", 5 more]]

Allowed operations with the key. Learn more.

One of the following:
"encrypt"
"decrypt"
"sign"
"verify"
"deriveKey"
"deriveBits"
"wrapKey"
"unwrapKey"
key_base64: Optional[str]

Base64-encoded key data. Required if format is “raw”, “pkcs8”, or “spki”.

key_jwk: Optional[object]

Key data in JSON Web Key format. Required if format is “jwk”.

class BindingWorkersBindingKindWorkflow:
name: str

A JavaScript variable name for the binding.

type: Literal["workflow"]

The kind of resource that the binding provides.

workflow_name: str

Name of the Workflow to bind to.

class_name: Optional[str]

Class name of the Workflow. Should only be provided if the Workflow belongs to this script.

script_name: Optional[str]

Script name that contains the Workflow. If not provided, defaults to this script name.

class BindingWorkersBindingKindWasmModule:
name: str

A JavaScript variable name for the binding.

part: str

The name of the file containing the WebAssembly module content. Only accepted for service worker syntax Workers.

Deprecatedtype: Literal["wasm_module"]

The kind of resource that the binding provides.

class BindingWorkersBindingKindVPCService:
name: str

A JavaScript variable name for the binding.

service_id: str

Identifier of the VPC service to bind to.

type: Literal["vpc_service"]

The kind of resource that the binding provides.

class BindingWorkersBindingKindVPCNetwork:
name: str

A JavaScript variable name for the binding.

type: Literal["vpc_network"]

The kind of resource that the binding provides.

network_id: Optional[str]

Identifier of the network to bind to. Only “cf1:network” is currently supported. Mutually exclusive with tunnel_id.

tunnel_id: Optional[str]

UUID of the Cloudflare Tunnel to bind to. Mutually exclusive with network_id.

cache_options: Optional[CacheOptions]

Global CacheW configuration for the Worker. When caching is on, the platform provisions a cloudflare.app zone for the Worker. A type: worker entry in the exports map can override this value for a single entrypoint.

enabled: bool

Whether caching is enabled for this Worker.

cross_version_cache: Optional[bool]

Whether cached responses are shared across Worker version uploads. This is independent of enabled. It can stay true while caching is off, so the preference survives turning caching off and back on.

compatibility_date: Optional[str]

Date indicating targeted support in the Workers runtime. Backwards incompatible fixes to the runtime following this date will not affect this Worker.

compatibility_flags: Optional[List[str]]

Flags that enable or disable certain features in the Workers runtime. Used to enable upcoming features or opt in or out of specific changes not included in a compatibility_date.

exports: Optional[Dict[str, Exports]]

Declarative exports for the Worker. Worker entrypoint entries (type: worker) carry cache configuration for that entrypoint.

One of the following:
class ExportsWorkersWorkerExport:

A named Worker entrypoint export (type: worker). Worker entrypoints are always live (state: created) and carry no storage or lifecycle fields. The optional cache block overrides the Worker’s global cache_options.enabled for this entrypoint.

type: Literal["worker"]

Marks this entry as a Worker entrypoint export.

cache: Optional[ExportsWorkersWorkerExportCache]

Cache override for this entrypoint. Overrides the Worker’s global cache_options.enabled for this entrypoint only.

enabled: bool

Whether caching is enabled for this entrypoint.

state: Optional[Literal["created"]]

Live export. May be omitted; defaults to created.

class ExportsWorkersDurableObjectExport:

A live Durable Object export (state: created, the default). The platform auto-provisions the namespace on first deploy, matches it on subsequent deploys, and never mutates or deletes it as a side effect of a code-only change. storage is required; renamed_to, transferred_to and transfer_from are not allowed on a live entry.

storage: Literal["sqlite", "legacy-kv"]

Durable Object storage backend. sqlite is the recommended (and only) backend for new namespaces. legacy-kv is accepted only for a class whose namespace already exists as KV-backed; the exports flow never provisions a new legacy-kv namespace.

One of the following:
"sqlite"
"legacy-kv"
type: Literal["durable-object"]

Marks this entry as a Durable Object export.

container: Optional[str]

Name of the container (declared in the upload’s metadata.containers) that backs this Durable Object. When set, the namespace is container-enabled. Valid only on live entries.

maxLength128
state: Optional[Literal["created"]]

Live export. May be omitted; defaults to created.

class ExportsWorkersDurableObjectDeletedExport:

A deleted tombstone: retires the provisioned namespace for this class and all of its data. The class must be absent from the uploaded code and no other Worker in the account may bind to the namespace, otherwise the deploy is rejected. No other fields are allowed. Deletion is irreversible.

state: Literal["deleted"]

Tombstone that deletes the namespace.

type: Literal["durable-object"]

Marks this entry as a Durable Object export.

class ExportsWorkersDurableObjectRenamedExport:

A renamed tombstone: rewrites the provisioned namespace’s class name from this map key to renamed_to. The source class may stay in code during the rollout window (an info notice is emitted). storage, transferred_to and transfer_from are not allowed.

renamed_to: str

The destination class name. Must differ from the source class (the map key) and must be declared as a live (created) entry in the same exports map. Write-only: never present in GET responses.

maxLength128
state: Literal["renamed"]

Tombstone that renames the namespace’s class.

type: Literal["durable-object"]

Marks this entry as a Durable Object export.

class ExportsWorkersDurableObjectTransferredExport:

A transferred tombstone (source side of a two-phase transfer): hands ownership of the provisioned namespace to another script in the same account, named by transferred_to. The target must have already deployed a matching expecting-transfer entry. The source class may stay in code during the rollout window (an info notice is emitted). storage, renamed_to and transfer_from are not allowed.

state: Literal["transferred"]

Tombstone that transfers the namespace to another script.

transferred_to: str

The destination script name. Must be in the same account and the same dispatch-namespace context (or both non-dispatch). Cross-dispatch-namespace transfers are rejected. Write-only: never present in GET responses.

maxLength128
type: Literal["durable-object"]

Marks this entry as a Durable Object export.

class ExportsWorkersDurableObjectExpectingTransferExport:

The target side of a two-phase transfer (state: expecting-transfer). Declares that this script expects to receive a namespace for this class from the transfer_from script. This is a live entry, not a tombstone: bindings resolve through the source’s namespace until the source commits with a transferred tombstone. storage and transfer_from are required; renamed_to and transferred_to are not allowed.

state: Literal["expecting-transfer"]

Target side of a two-phase transfer.

storage: Literal["sqlite", "legacy-kv"]

Durable Object storage backend. sqlite is the recommended (and only) backend for new namespaces. legacy-kv is accepted only for a class whose namespace already exists as KV-backed; the exports flow never provisions a new legacy-kv namespace.

One of the following:
"sqlite"
"legacy-kv"
transfer_from: str

The source script name to receive the namespace from. Must be in the same account and dispatch-namespace context. Present on reads for expecting-transfer entries.

maxLength128
type: Literal["durable-object"]

Marks this entry as a Durable Object export.

container: Optional[str]

Name of the container (declared in the upload’s metadata.containers) that backs this Durable Object once the transfer settles. Valid only on live entries.

maxLength128
exports_reconciliation: Optional[ExportsReconciliation]

Summary of the declarative exports reconciliation that ran on this upload. Populated only when the uploaded metadata included an exports block. Durable Object entries drive reconciliation; type: worker entries do not contribute to this summary.

created: List[str]

Class names for which a new namespace was provisioned.

deleted: List[str]

Class names whose namespace was deleted by a deleted tombstone.

info: List[ExportsReconciliationInfo]

Non-blocking info entries (stale tombstones, tombstone applied with class still in code). See exports_reconciliation_info.

class_: str

The class name the info entry is about.

message: str

Human-readable explanation.

scenario: Literal["code_class_not_in_exports", "provisioned_class_missing_from_config", "config_export_not_in_code", 30 more]

Stable, machine-readable tag identifying which reconciliation scenario produced an error, warning, or info entry. Clients may branch on this value instead of parsing message.

One of the following:
"code_class_not_in_exports"
"provisioned_class_missing_from_config"
"config_export_not_in_code"
"config_references_nonexistent_class"
"orphaned_provisioned_namespace"
"storage_type_mismatch"
"free_tier_requires_sqlite"
"invalid_export"
"tombstone_delete_class_still_in_code"
"tombstone_delete_blocked_by_external_bindings"
"tombstone_renamed_to_occupied"
"transferred_pending_not_found"
"transferred_target_missing"
"transferred_target_mismatch"
"phase_one_transfer_source_missing"
"phase_one_transfer_source_namespace_missing"
"phase_one_transfer_target_class_provisioned"
"phase_one_transfer_after_commit_mismatch"
"phase_one_transfer_duplicate"
"phase_one_transfer_target_in_dispatch_namespace"
"phase_one_transfer_source_in_dispatch_namespace"
"transferred_source_in_dispatch_namespace"
"transferred_target_in_dispatch_namespace"
"container_undeclared_reference"
"container_class_not_durable_object"
"container_wiring_inconsistent"
"container_multiple_durable_objects"
"transfer_container_parity_mismatch"
"transfer_container_parity_mismatch_on_commit"
"tombstone_class_still_in_code"
"stale_tombstone"
"transfer_receive_already_applied"
"transfer_receive_cleanup_complete"
namespace_id: Optional[str]

The provisioned namespace the entry relates to, when applicable.

formatuuid
referencing_scripts: Optional[List[str]]

Other Workers in the account that still bind to the affected class. Advisory: while non-empty the tombstone is not yet safe to remove — redeploy these Workers with bindings re-pointed first.

removable_entries: List[str]

Source class names whose tombstone entry is now stale and safe to delete from exports (no remaining referencing scripts).

renamed: List[ExportsReconciliationRenamed]

Applied renamed tombstones.

from_: str

The original (source) class name.

to: str

The new class name (renamed_to).

transfer_pending: List[ExportsReconciliationTransferPending]

Phase-1 transfer hints recorded on the target side.

class_: str

The target-side class name awaiting transfer.

from_: str

The source script the namespace will be transferred from.

transferred: List[ExportsReconciliationTransferred]

Committed transferred tombstones (phase-2).

class_: str

The source class name that was transferred.

phase: Literal["committed"]

The transfer phase. Currently always committed.

to: str

The destination script that now owns the namespace.

updated: List[str]

Class names whose provisioned namespace was mutated in place.

warnings: List[ExportsReconciliationWarning]

Non-blocking warnings. See exports_reconciliation_warning.

class_: str

The class name the warning is about.

message: str

Human-readable explanation of the warning.

scenario: Literal["code_class_not_in_exports", "provisioned_class_missing_from_config", "config_export_not_in_code", 30 more]

Stable, machine-readable tag identifying which reconciliation scenario produced an error, warning, or info entry. Clients may branch on this value instead of parsing message.

One of the following:
"code_class_not_in_exports"
"provisioned_class_missing_from_config"
"config_export_not_in_code"
"config_references_nonexistent_class"
"orphaned_provisioned_namespace"
"storage_type_mismatch"
"free_tier_requires_sqlite"
"invalid_export"
"tombstone_delete_class_still_in_code"
"tombstone_delete_blocked_by_external_bindings"
"tombstone_renamed_to_occupied"
"transferred_pending_not_found"
"transferred_target_missing"
"transferred_target_mismatch"
"phase_one_transfer_source_missing"
"phase_one_transfer_source_namespace_missing"
"phase_one_transfer_target_class_provisioned"
"phase_one_transfer_after_commit_mismatch"
"phase_one_transfer_duplicate"
"phase_one_transfer_target_in_dispatch_namespace"
"phase_one_transfer_source_in_dispatch_namespace"
"transferred_source_in_dispatch_namespace"
"transferred_target_in_dispatch_namespace"
"container_undeclared_reference"
"container_class_not_durable_object"
"container_wiring_inconsistent"
"container_multiple_durable_objects"
"transfer_container_parity_mismatch"
"transfer_container_parity_mismatch_on_commit"
"tombstone_class_still_in_code"
"stale_tombstone"
"transfer_receive_already_applied"
"transfer_receive_cleanup_complete"
namespace_id: Optional[str]

The provisioned namespace the warning relates to, when applicable.

formatuuid
limits: Optional[Limits]

Limits to apply for this Worker.

cpu_ms: Optional[int]

The amount of CPU time this Worker can use in milliseconds.

subrequests: Optional[int]

The number of subrequests this Worker can make per request.

logpush: Optional[bool]

Whether Logpush is turned on for the Worker.

migrations: Optional[Migrations]

Migrations to apply for Durable Objects associated with this Worker.

One of the following:
class SingleStepMigration:

A single set of migrations to apply.

deleted_classes: Optional[List[str]]

A list of classes to delete Durable Object namespaces from.

new_classes: Optional[List[str]]

A list of classes to create Durable Object namespaces from.

new_sqlite_classes: Optional[List[str]]

A list of classes to create Durable Object namespaces with SQLite from.

new_tag: Optional[str]

Tag to set as the latest migration tag.

old_tag: Optional[str]

Tag used to verify against the latest migration tag for this Worker. If they don’t match, the upload is rejected.

renamed_classes: Optional[List[RenamedClass]]

A list of classes with Durable Object namespaces that were renamed.

from_: Optional[str]
to: Optional[str]
transferred_classes: Optional[List[TransferredClass]]

A list of transfers for Durable Object namespaces from a different Worker and class to a class defined in this Worker.

from_: Optional[str]
from_script: Optional[str]
to: Optional[str]
class MigrationsWorkersMultipleStepMigrations:
new_tag: Optional[str]

Tag to set as the latest migration tag.

old_tag: Optional[str]

Tag used to verify against the latest migration tag for this Worker. If they don’t match, the upload is rejected.

steps: Optional[List[MigrationStep]]

Migrations to apply in order.

deleted_classes: Optional[List[str]]

A list of classes to delete Durable Object namespaces from.

new_classes: Optional[List[str]]

A list of classes to create Durable Object namespaces from.

new_sqlite_classes: Optional[List[str]]

A list of classes to create Durable Object namespaces with SQLite from.

renamed_classes: Optional[List[RenamedClass]]

A list of classes with Durable Object namespaces that were renamed.

from_: Optional[str]
to: Optional[str]
transferred_classes: Optional[List[TransferredClass]]

A list of transfers for Durable Object namespaces from a different Worker and class to a class defined in this Worker.

from_: Optional[str]
from_script: Optional[str]
to: Optional[str]
observability: Optional[Observability]

Observability settings for the Worker.

enabled: bool

Whether observability is enabled for the Worker.

head_sampling_rate: Optional[float]

The sampling rate for incoming requests. From 0 to 1 (1 = 100%, 0.1 = 10%). Default is 1.

logs: Optional[ObservabilityLogs]

Log settings for the Worker.

enabled: bool

Whether logs are enabled for the Worker.

invocation_logs: bool

Whether invocation logs are enabled for the Worker.

destinations: Optional[List[str]]

A list of destinations where logs will be exported to.

head_sampling_rate: Optional[float]

The sampling rate for logs. From 0 to 1 (1 = 100%, 0.1 = 10%). Default is 1.

persist: Optional[bool]

Whether log persistence is enabled for the Worker.

traces: Optional[ObservabilityTraces]

Trace settings for the Worker.

destinations: Optional[List[str]]

A list of destinations where traces will be exported to.

enabled: Optional[bool]

Whether traces are enabled for the Worker.

head_sampling_rate: Optional[float]

The sampling rate for traces. From 0 to 1 (1 = 100%, 0.1 = 10%). Default is 1.

persist: Optional[bool]

Whether trace persistence is enabled for the Worker.

propagation_policy: Optional[Literal["authenticated", "accept"]]

Controls how inbound trace context (traceparent/tracestate) headers on incoming requests are handled. “authenticated” (default) honors inbound trace context only when accompanied by a valid trace auth token. “accept” unconditionally accepts inbound trace context. Requires the trace propagation feature to be enabled.

One of the following:
"authenticated"
"accept"
placement: Optional[Placement]

Configuration for Smart Placement. Specify mode=‘smart’ for Smart Placement, or one of region/hostname/host.

One of the following:
class PlacementMode:
mode: Literal["smart"]
class PlacementRegion:
region: str

Cloud region for targeted placement in format ‘provider:region’.

class PlacementHostname:
hostname: str

HTTP hostname for targeted placement.

class PlacementHost:
host: str

TCP host and port for targeted placement.

class PlacementUnionMember4:
mode: Literal["targeted"]

Targeted placement mode.

region: str

Cloud region for targeted placement in format ‘provider:region’.

class PlacementUnionMember5:
hostname: str

HTTP hostname for targeted placement.

mode: Literal["targeted"]

Targeted placement mode.

class PlacementUnionMember6:
host: str

TCP host and port for targeted placement.

mode: Literal["targeted"]

Targeted placement mode.

class PlacementUnionMember7:
mode: Literal["targeted"]

Targeted placement mode.

target: List[PlacementUnionMember7Target]

Array of placement targets (currently limited to single target).

One of the following:
class PlacementUnionMember7TargetRegion:
region: str

Cloud region in format ‘provider:region’.

class PlacementUnionMember7TargetHostname:
hostname: str

HTTP hostname for targeted placement.

class PlacementUnionMember7TargetHost:
host: str

TCP host:port for targeted placement.

tags: Optional[List[str]]

Tags associated with the Worker.

tail_consumers: Optional[List[ConsumerScript]]

List of Workers that will consume logs from the attached Worker.

service: str

Name of Worker that is to be the consumer.

environment: Optional[str]

Optional environment if the Worker utilizes one.

namespace: Optional[str]

Optional dispatch namespace the script belongs to.

usage_model: Optional[Literal["standard", "bundled", "unbound"]]

Usage model for the Worker invocations.

One of the following:
"standard"
"bundled"
"unbound"
class SettingEditResponse:

Script and version settings for Workers for Platforms namespace scripts. Same as script-and-version-settings-item but without annotations, which are not supported for namespace scripts.

bindings: Optional[List[Binding]]

List of bindings attached to a Worker. You can find more about bindings on our docs: https://developers.cloudflare.com/workers/configuration/multipart-upload-metadata/#bindings.

One of the following:
class BindingWorkersBindingKindAI:
name: str

A JavaScript variable name for the binding.

type: Literal["ai"]

The kind of resource that the binding provides.

class BindingWorkersBindingKindAISearch:
instance_name: str

The user-chosen instance name. Must exist at deploy time. The worker can search, chat, update, and manage items/jobs on this instance.

name: str

A JavaScript variable name for the binding.

type: Literal["ai_search"]

The kind of resource that the binding provides.

namespace: Optional[str]

The namespace the instance belongs to. Defaults to “default” if omitted. Customers who don’t use namespaces can simply omit this field.

class BindingWorkersBindingKindAISearchNamespace:
name: str

A JavaScript variable name for the binding.

namespace: str

The user-chosen namespace name. Must exist before deploy — Wrangler handles auto-creation on deploy failure (R2 bucket pattern). The “default” namespace is auto-created by config-api for new accounts. Grants full access (CRUD + search + chat) to all instances within the namespace.

type: Literal["ai_search_namespace"]

The kind of resource that the binding provides.

class BindingWorkersBindingKindAnalyticsEngine:
dataset: str

The name of the dataset to bind to.

name: str

A JavaScript variable name for the binding.

type: Literal["analytics_engine"]

The kind of resource that the binding provides.

class BindingWorkersBindingKindAssets:
name: str

A JavaScript variable name for the binding.

type: Literal["assets"]

The kind of resource that the binding provides.

class BindingWorkersBindingKindBrowser:
name: str

A JavaScript variable name for the binding.

type: Literal["browser"]

The kind of resource that the binding provides.

class BindingWorkersBindingKindD1:
database_id: str

Identifier of the D1 database to bind to.

name: str

A JavaScript variable name for the binding.

type: Literal["d1"]

The kind of resource that the binding provides.

Deprecatedid: Optional[str]

This property has been renamed to database_id.

Identifier of the D1 database to bind to.

class BindingWorkersBindingKindDataBlob:
name: str

A JavaScript variable name for the binding.

part: str

The name of the file containing the data content. Only accepted for service worker syntax Workers.

Deprecatedtype: Literal["data_blob"]

The kind of resource that the binding provides.

class BindingWorkersBindingKindDispatchNamespace:
name: str

A JavaScript variable name for the binding.

namespace: str

The name of the dispatch namespace.

type: Literal["dispatch_namespace"]

The kind of resource that the binding provides.

outbound: Optional[BindingWorkersBindingKindDispatchNamespaceOutbound]

Outbound worker.

params: Optional[List[BindingWorkersBindingKindDispatchNamespaceOutboundParam]]

Pass information from the Dispatch Worker to the Outbound Worker through the parameters.

name: str

Name of the parameter.

worker: Optional[BindingWorkersBindingKindDispatchNamespaceOutboundWorker]

Outbound worker.

entrypoint: Optional[str]

Entrypoint to invoke on the outbound worker.

environment: Optional[str]

Environment of the outbound worker.

service: Optional[str]

Name of the outbound worker.

class BindingWorkersBindingKindDurableObjectNamespace:
name: str

A JavaScript variable name for the binding.

type: Literal["durable_object_namespace"]

The kind of resource that the binding provides.

class_name: Optional[str]

The exported class name of the Durable Object.

dispatch_namespace: Optional[str]

The dispatch namespace the Durable Object script belongs to.

environment: Optional[str]

The environment of the script_name to bind to.

namespace_id: Optional[str]

Namespace identifier tag.

maxLength32
script_name: Optional[str]

The script where the Durable Object is defined, if it is external to this Worker.

class BindingWorkersBindingKindHyperdrive:
id: str

Identifier of the Hyperdrive connection to bind to.

name: str

A JavaScript variable name for the binding.

type: Literal["hyperdrive"]

The kind of resource that the binding provides.

class BindingWorkersBindingKindInherit:
name: str

The name of the inherited binding.

type: Literal["inherit"]

The kind of resource that the binding provides.

old_name: Optional[str]

The old name of the inherited binding. If set, the binding will be renamed from old_name to name in the new version. If not set, the binding will keep the same name between versions.

version_id: Optional[str]

Identifier for the version to inherit the binding from, which can be the version ID or the literal “latest” to inherit from the latest version. Defaults to inheriting the binding from the latest version.

class BindingWorkersBindingKindImages:
name: str

A JavaScript variable name for the binding.

type: Literal["images"]

The kind of resource that the binding provides.

class BindingWorkersBindingKindJson:
json: object

JSON data to use.

name: str

A JavaScript variable name for the binding.

type: Literal["json"]

The kind of resource that the binding provides.

class BindingWorkersBindingKindKVNamespace:
name: str

A JavaScript variable name for the binding.

namespace_id: str

Namespace identifier tag.

maxLength32
type: Literal["kv_namespace"]

The kind of resource that the binding provides.

class BindingWorkersBindingKindMedia:
name: str

A JavaScript variable name for the binding.

type: Literal["media"]

The kind of resource that the binding provides.

class BindingWorkersBindingKindMTLSCertificate:
certificate_id: str

Identifier of the certificate to bind to.

name: str

A JavaScript variable name for the binding.

type: Literal["mtls_certificate"]

The kind of resource that the binding provides.

class BindingWorkersBindingKindPlainText:
name: str

A JavaScript variable name for the binding.

text: str

The text value to use.

type: Literal["plain_text"]

The kind of resource that the binding provides.

class BindingWorkersBindingKindPipelines:
name: str

A JavaScript variable name for the binding.

pipeline: str

Name of the Pipeline to bind to.

type: Literal["pipelines"]

The kind of resource that the binding provides.

class BindingWorkersBindingKindQueue:
name: str

A JavaScript variable name for the binding.

queue_name: str

Name of the Queue to bind to.

type: Literal["queue"]

The kind of resource that the binding provides.

class BindingWorkersBindingKindRatelimit:
name: str

A JavaScript variable name for the binding.

namespace_id: str

Identifier of the rate limit namespace to bind to.

simple: BindingWorkersBindingKindRatelimitSimple

The rate limit configuration.

limit: float

The limit (requests per period).

period: int

The period in seconds.

mitigation_timeout: Optional[int]

Duration in seconds to apply the mitigation action after the rate limit is exceeded. Valid values are 0 (disabled), 10, or multiples of 60 up to 86400. Must be greater than or equal to the period when non-zero.

type: Literal["ratelimit"]

The kind of resource that the binding provides.

class BindingWorkersBindingKindR2Bucket:
bucket_name: str

R2 bucket to bind to.

name: str

A JavaScript variable name for the binding.

type: Literal["r2_bucket"]

The kind of resource that the binding provides.

jurisdiction: Optional[Literal["eu", "fedramp", "fedramp-high"]]

The jurisdiction of the R2 bucket.

One of the following:
"eu"
"fedramp"
"fedramp-high"
class BindingWorkersBindingKindSecretText:
name: str

A JavaScript variable name for the binding.

text: str

The secret value to use.

type: Literal["secret_text"]

The kind of resource that the binding provides.

class BindingWorkersBindingKindSendEmail:
name: str

A JavaScript variable name for the binding.

type: Literal["send_email"]

The kind of resource that the binding provides.

allowed_destination_addresses: Optional[List[str]]

List of allowed destination addresses.

allowed_sender_addresses: Optional[List[str]]

List of allowed sender addresses.

destination_address: Optional[str]

Destination address for the email.

formatemail
class BindingWorkersBindingKindService:
name: str

A JavaScript variable name for the binding.

service: str

Name of Worker to bind to.

type: Literal["service"]

The kind of resource that the binding provides.

entrypoint: Optional[str]

Entrypoint to invoke on the target Worker.

environment: Optional[str]

Optional environment if the Worker utilizes one.

class BindingWorkersBindingKindTextBlob:
name: str

A JavaScript variable name for the binding.

part: str

The name of the file containing the text content. Only accepted for service worker syntax Workers.

Deprecatedtype: Literal["text_blob"]

The kind of resource that the binding provides.

class BindingWorkersBindingKindVectorize:
index_name: str

Name of the Vectorize index to bind to.

name: str

A JavaScript variable name for the binding.

type: Literal["vectorize"]

The kind of resource that the binding provides.

class BindingWorkersBindingKindVersionMetadata:
name: str

A JavaScript variable name for the binding.

type: Literal["version_metadata"]

The kind of resource that the binding provides.

class BindingWorkersBindingKindSecretsStoreSecret:
name: str

A JavaScript variable name for the binding.

secret_name: str

Name of the secret in the store.

store_id: str

ID of the store containing the secret.

type: Literal["secrets_store_secret"]

The kind of resource that the binding provides.

class BindingWorkersBindingKindFlagship:
app_id: str

ID of the Flagship app to bind to for feature flag evaluation.

maxLength128
name: str

A JavaScript variable name for the binding.

type: Literal["flagship"]

The kind of resource that the binding provides.

class BindingWorkersBindingKindSecretKey:
algorithm: object

Algorithm-specific key parameters. Learn more.

format: Literal["raw", "pkcs8", "spki", "jwk"]

Data format of the key. Learn more.

One of the following:
"raw"
"pkcs8"
"spki"
"jwk"
name: str

A JavaScript variable name for the binding.

type: Literal["secret_key"]

The kind of resource that the binding provides.

usages: List[Literal["encrypt", "decrypt", "sign", 5 more]]

Allowed operations with the key. Learn more.

One of the following:
"encrypt"
"decrypt"
"sign"
"verify"
"deriveKey"
"deriveBits"
"wrapKey"
"unwrapKey"
key_base64: Optional[str]

Base64-encoded key data. Required if format is “raw”, “pkcs8”, or “spki”.

key_jwk: Optional[object]

Key data in JSON Web Key format. Required if format is “jwk”.

class BindingWorkersBindingKindWorkflow:
name: str

A JavaScript variable name for the binding.

type: Literal["workflow"]

The kind of resource that the binding provides.

workflow_name: str

Name of the Workflow to bind to.

class_name: Optional[str]

Class name of the Workflow. Should only be provided if the Workflow belongs to this script.

script_name: Optional[str]

Script name that contains the Workflow. If not provided, defaults to this script name.

class BindingWorkersBindingKindWasmModule:
name: str

A JavaScript variable name for the binding.

part: str

The name of the file containing the WebAssembly module content. Only accepted for service worker syntax Workers.

Deprecatedtype: Literal["wasm_module"]

The kind of resource that the binding provides.

class BindingWorkersBindingKindVPCService:
name: str

A JavaScript variable name for the binding.

service_id: str

Identifier of the VPC service to bind to.

type: Literal["vpc_service"]

The kind of resource that the binding provides.

class BindingWorkersBindingKindVPCNetwork:
name: str

A JavaScript variable name for the binding.

type: Literal["vpc_network"]

The kind of resource that the binding provides.

network_id: Optional[str]

Identifier of the network to bind to. Only “cf1:network” is currently supported. Mutually exclusive with tunnel_id.

tunnel_id: Optional[str]

UUID of the Cloudflare Tunnel to bind to. Mutually exclusive with network_id.

cache_options: Optional[CacheOptions]

Global CacheW configuration for the Worker. When caching is on, the platform provisions a cloudflare.app zone for the Worker. A type: worker entry in the exports map can override this value for a single entrypoint.

enabled: bool

Whether caching is enabled for this Worker.

cross_version_cache: Optional[bool]

Whether cached responses are shared across Worker version uploads. This is independent of enabled. It can stay true while caching is off, so the preference survives turning caching off and back on.

compatibility_date: Optional[str]

Date indicating targeted support in the Workers runtime. Backwards incompatible fixes to the runtime following this date will not affect this Worker.

compatibility_flags: Optional[List[str]]

Flags that enable or disable certain features in the Workers runtime. Used to enable upcoming features or opt in or out of specific changes not included in a compatibility_date.

exports: Optional[Dict[str, Exports]]

Declarative exports for the Worker. Worker entrypoint entries (type: worker) carry cache configuration for that entrypoint.

One of the following:
class ExportsWorkersWorkerExport:

A named Worker entrypoint export (type: worker). Worker entrypoints are always live (state: created) and carry no storage or lifecycle fields. The optional cache block overrides the Worker’s global cache_options.enabled for this entrypoint.

type: Literal["worker"]

Marks this entry as a Worker entrypoint export.

cache: Optional[ExportsWorkersWorkerExportCache]

Cache override for this entrypoint. Overrides the Worker’s global cache_options.enabled for this entrypoint only.

enabled: bool

Whether caching is enabled for this entrypoint.

state: Optional[Literal["created"]]

Live export. May be omitted; defaults to created.

class ExportsWorkersDurableObjectExport:

A live Durable Object export (state: created, the default). The platform auto-provisions the namespace on first deploy, matches it on subsequent deploys, and never mutates or deletes it as a side effect of a code-only change. storage is required; renamed_to, transferred_to and transfer_from are not allowed on a live entry.

storage: Literal["sqlite", "legacy-kv"]

Durable Object storage backend. sqlite is the recommended (and only) backend for new namespaces. legacy-kv is accepted only for a class whose namespace already exists as KV-backed; the exports flow never provisions a new legacy-kv namespace.

One of the following:
"sqlite"
"legacy-kv"
type: Literal["durable-object"]

Marks this entry as a Durable Object export.

container: Optional[str]

Name of the container (declared in the upload’s metadata.containers) that backs this Durable Object. When set, the namespace is container-enabled. Valid only on live entries.

maxLength128
state: Optional[Literal["created"]]

Live export. May be omitted; defaults to created.

class ExportsWorkersDurableObjectDeletedExport:

A deleted tombstone: retires the provisioned namespace for this class and all of its data. The class must be absent from the uploaded code and no other Worker in the account may bind to the namespace, otherwise the deploy is rejected. No other fields are allowed. Deletion is irreversible.

state: Literal["deleted"]

Tombstone that deletes the namespace.

type: Literal["durable-object"]

Marks this entry as a Durable Object export.

class ExportsWorkersDurableObjectRenamedExport:

A renamed tombstone: rewrites the provisioned namespace’s class name from this map key to renamed_to. The source class may stay in code during the rollout window (an info notice is emitted). storage, transferred_to and transfer_from are not allowed.

renamed_to: str

The destination class name. Must differ from the source class (the map key) and must be declared as a live (created) entry in the same exports map. Write-only: never present in GET responses.

maxLength128
state: Literal["renamed"]

Tombstone that renames the namespace’s class.

type: Literal["durable-object"]

Marks this entry as a Durable Object export.

class ExportsWorkersDurableObjectTransferredExport:

A transferred tombstone (source side of a two-phase transfer): hands ownership of the provisioned namespace to another script in the same account, named by transferred_to. The target must have already deployed a matching expecting-transfer entry. The source class may stay in code during the rollout window (an info notice is emitted). storage, renamed_to and transfer_from are not allowed.

state: Literal["transferred"]

Tombstone that transfers the namespace to another script.

transferred_to: str

The destination script name. Must be in the same account and the same dispatch-namespace context (or both non-dispatch). Cross-dispatch-namespace transfers are rejected. Write-only: never present in GET responses.

maxLength128
type: Literal["durable-object"]

Marks this entry as a Durable Object export.

class ExportsWorkersDurableObjectExpectingTransferExport:

The target side of a two-phase transfer (state: expecting-transfer). Declares that this script expects to receive a namespace for this class from the transfer_from script. This is a live entry, not a tombstone: bindings resolve through the source’s namespace until the source commits with a transferred tombstone. storage and transfer_from are required; renamed_to and transferred_to are not allowed.

state: Literal["expecting-transfer"]

Target side of a two-phase transfer.

storage: Literal["sqlite", "legacy-kv"]

Durable Object storage backend. sqlite is the recommended (and only) backend for new namespaces. legacy-kv is accepted only for a class whose namespace already exists as KV-backed; the exports flow never provisions a new legacy-kv namespace.

One of the following:
"sqlite"
"legacy-kv"
transfer_from: str

The source script name to receive the namespace from. Must be in the same account and dispatch-namespace context. Present on reads for expecting-transfer entries.

maxLength128
type: Literal["durable-object"]

Marks this entry as a Durable Object export.

container: Optional[str]

Name of the container (declared in the upload’s metadata.containers) that backs this Durable Object once the transfer settles. Valid only on live entries.

maxLength128
exports_reconciliation: Optional[ExportsReconciliation]

Summary of the declarative exports reconciliation that ran on this upload. Populated only when the uploaded metadata included an exports block. Durable Object entries drive reconciliation; type: worker entries do not contribute to this summary.

created: List[str]

Class names for which a new namespace was provisioned.

deleted: List[str]

Class names whose namespace was deleted by a deleted tombstone.

info: List[ExportsReconciliationInfo]

Non-blocking info entries (stale tombstones, tombstone applied with class still in code). See exports_reconciliation_info.

class_: str

The class name the info entry is about.

message: str

Human-readable explanation.

scenario: Literal["code_class_not_in_exports", "provisioned_class_missing_from_config", "config_export_not_in_code", 30 more]

Stable, machine-readable tag identifying which reconciliation scenario produced an error, warning, or info entry. Clients may branch on this value instead of parsing message.

One of the following:
"code_class_not_in_exports"
"provisioned_class_missing_from_config"
"config_export_not_in_code"
"config_references_nonexistent_class"
"orphaned_provisioned_namespace"
"storage_type_mismatch"
"free_tier_requires_sqlite"
"invalid_export"
"tombstone_delete_class_still_in_code"
"tombstone_delete_blocked_by_external_bindings"
"tombstone_renamed_to_occupied"
"transferred_pending_not_found"
"transferred_target_missing"
"transferred_target_mismatch"
"phase_one_transfer_source_missing"
"phase_one_transfer_source_namespace_missing"
"phase_one_transfer_target_class_provisioned"
"phase_one_transfer_after_commit_mismatch"
"phase_one_transfer_duplicate"
"phase_one_transfer_target_in_dispatch_namespace"
"phase_one_transfer_source_in_dispatch_namespace"
"transferred_source_in_dispatch_namespace"
"transferred_target_in_dispatch_namespace"
"container_undeclared_reference"
"container_class_not_durable_object"
"container_wiring_inconsistent"
"container_multiple_durable_objects"
"transfer_container_parity_mismatch"
"transfer_container_parity_mismatch_on_commit"
"tombstone_class_still_in_code"
"stale_tombstone"
"transfer_receive_already_applied"
"transfer_receive_cleanup_complete"
namespace_id: Optional[str]

The provisioned namespace the entry relates to, when applicable.

formatuuid
referencing_scripts: Optional[List[str]]

Other Workers in the account that still bind to the affected class. Advisory: while non-empty the tombstone is not yet safe to remove — redeploy these Workers with bindings re-pointed first.

removable_entries: List[str]

Source class names whose tombstone entry is now stale and safe to delete from exports (no remaining referencing scripts).

renamed: List[ExportsReconciliationRenamed]

Applied renamed tombstones.

from_: str

The original (source) class name.

to: str

The new class name (renamed_to).

transfer_pending: List[ExportsReconciliationTransferPending]

Phase-1 transfer hints recorded on the target side.

class_: str

The target-side class name awaiting transfer.

from_: str

The source script the namespace will be transferred from.

transferred: List[ExportsReconciliationTransferred]

Committed transferred tombstones (phase-2).

class_: str

The source class name that was transferred.

phase: Literal["committed"]

The transfer phase. Currently always committed.

to: str

The destination script that now owns the namespace.

updated: List[str]

Class names whose provisioned namespace was mutated in place.

warnings: List[ExportsReconciliationWarning]

Non-blocking warnings. See exports_reconciliation_warning.

class_: str

The class name the warning is about.

message: str

Human-readable explanation of the warning.

scenario: Literal["code_class_not_in_exports", "provisioned_class_missing_from_config", "config_export_not_in_code", 30 more]

Stable, machine-readable tag identifying which reconciliation scenario produced an error, warning, or info entry. Clients may branch on this value instead of parsing message.

One of the following:
"code_class_not_in_exports"
"provisioned_class_missing_from_config"
"config_export_not_in_code"
"config_references_nonexistent_class"
"orphaned_provisioned_namespace"
"storage_type_mismatch"
"free_tier_requires_sqlite"
"invalid_export"
"tombstone_delete_class_still_in_code"
"tombstone_delete_blocked_by_external_bindings"
"tombstone_renamed_to_occupied"
"transferred_pending_not_found"
"transferred_target_missing"
"transferred_target_mismatch"
"phase_one_transfer_source_missing"
"phase_one_transfer_source_namespace_missing"
"phase_one_transfer_target_class_provisioned"
"phase_one_transfer_after_commit_mismatch"
"phase_one_transfer_duplicate"
"phase_one_transfer_target_in_dispatch_namespace"
"phase_one_transfer_source_in_dispatch_namespace"
"transferred_source_in_dispatch_namespace"
"transferred_target_in_dispatch_namespace"
"container_undeclared_reference"
"container_class_not_durable_object"
"container_wiring_inconsistent"
"container_multiple_durable_objects"
"transfer_container_parity_mismatch"
"transfer_container_parity_mismatch_on_commit"
"tombstone_class_still_in_code"
"stale_tombstone"
"transfer_receive_already_applied"
"transfer_receive_cleanup_complete"
namespace_id: Optional[str]

The provisioned namespace the warning relates to, when applicable.

formatuuid
limits: Optional[Limits]

Limits to apply for this Worker.

cpu_ms: Optional[int]

The amount of CPU time this Worker can use in milliseconds.

subrequests: Optional[int]

The number of subrequests this Worker can make per request.

logpush: Optional[bool]

Whether Logpush is turned on for the Worker.

migrations: Optional[Migrations]

Migrations to apply for Durable Objects associated with this Worker.

One of the following:
class SingleStepMigration:

A single set of migrations to apply.

deleted_classes: Optional[List[str]]

A list of classes to delete Durable Object namespaces from.

new_classes: Optional[List[str]]

A list of classes to create Durable Object namespaces from.

new_sqlite_classes: Optional[List[str]]

A list of classes to create Durable Object namespaces with SQLite from.

new_tag: Optional[str]

Tag to set as the latest migration tag.

old_tag: Optional[str]

Tag used to verify against the latest migration tag for this Worker. If they don’t match, the upload is rejected.

renamed_classes: Optional[List[RenamedClass]]

A list of classes with Durable Object namespaces that were renamed.

from_: Optional[str]
to: Optional[str]
transferred_classes: Optional[List[TransferredClass]]

A list of transfers for Durable Object namespaces from a different Worker and class to a class defined in this Worker.

from_: Optional[str]
from_script: Optional[str]
to: Optional[str]
class MigrationsWorkersMultipleStepMigrations:
new_tag: Optional[str]

Tag to set as the latest migration tag.

old_tag: Optional[str]

Tag used to verify against the latest migration tag for this Worker. If they don’t match, the upload is rejected.

steps: Optional[List[MigrationStep]]

Migrations to apply in order.

deleted_classes: Optional[List[str]]

A list of classes to delete Durable Object namespaces from.

new_classes: Optional[List[str]]

A list of classes to create Durable Object namespaces from.

new_sqlite_classes: Optional[List[str]]

A list of classes to create Durable Object namespaces with SQLite from.

renamed_classes: Optional[List[RenamedClass]]

A list of classes with Durable Object namespaces that were renamed.

from_: Optional[str]
to: Optional[str]
transferred_classes: Optional[List[TransferredClass]]

A list of transfers for Durable Object namespaces from a different Worker and class to a class defined in this Worker.

from_: Optional[str]
from_script: Optional[str]
to: Optional[str]
observability: Optional[Observability]

Observability settings for the Worker.

enabled: bool

Whether observability is enabled for the Worker.

head_sampling_rate: Optional[float]

The sampling rate for incoming requests. From 0 to 1 (1 = 100%, 0.1 = 10%). Default is 1.

logs: Optional[ObservabilityLogs]

Log settings for the Worker.

enabled: bool

Whether logs are enabled for the Worker.

invocation_logs: bool

Whether invocation logs are enabled for the Worker.

destinations: Optional[List[str]]

A list of destinations where logs will be exported to.

head_sampling_rate: Optional[float]

The sampling rate for logs. From 0 to 1 (1 = 100%, 0.1 = 10%). Default is 1.

persist: Optional[bool]

Whether log persistence is enabled for the Worker.

traces: Optional[ObservabilityTraces]

Trace settings for the Worker.

destinations: Optional[List[str]]

A list of destinations where traces will be exported to.

enabled: Optional[bool]

Whether traces are enabled for the Worker.

head_sampling_rate: Optional[float]

The sampling rate for traces. From 0 to 1 (1 = 100%, 0.1 = 10%). Default is 1.

persist: Optional[bool]

Whether trace persistence is enabled for the Worker.

propagation_policy: Optional[Literal["authenticated", "accept"]]

Controls how inbound trace context (traceparent/tracestate) headers on incoming requests are handled. “authenticated” (default) honors inbound trace context only when accompanied by a valid trace auth token. “accept” unconditionally accepts inbound trace context. Requires the trace propagation feature to be enabled.

One of the following:
"authenticated"
"accept"
placement: Optional[Placement]

Configuration for Smart Placement. Specify mode=‘smart’ for Smart Placement, or one of region/hostname/host.

One of the following:
class PlacementMode:
mode: Literal["smart"]
class PlacementRegion:
region: str

Cloud region for targeted placement in format ‘provider:region’.

class PlacementHostname:
hostname: str

HTTP hostname for targeted placement.

class PlacementHost:
host: str

TCP host and port for targeted placement.

class PlacementUnionMember4:
mode: Literal["targeted"]

Targeted placement mode.

region: str

Cloud region for targeted placement in format ‘provider:region’.

class PlacementUnionMember5:
hostname: str

HTTP hostname for targeted placement.

mode: Literal["targeted"]

Targeted placement mode.

class PlacementUnionMember6:
host: str

TCP host and port for targeted placement.

mode: Literal["targeted"]

Targeted placement mode.

class PlacementUnionMember7:
mode: Literal["targeted"]

Targeted placement mode.

target: List[PlacementUnionMember7Target]

Array of placement targets (currently limited to single target).

One of the following:
class PlacementUnionMember7TargetRegion:
region: str

Cloud region in format ‘provider:region’.

class PlacementUnionMember7TargetHostname:
hostname: str

HTTP hostname for targeted placement.

class PlacementUnionMember7TargetHost:
host: str

TCP host:port for targeted placement.

tags: Optional[List[str]]

Tags associated with the Worker.

tail_consumers: Optional[List[ConsumerScript]]

List of Workers that will consume logs from the attached Worker.

service: str

Name of Worker that is to be the consumer.

environment: Optional[str]

Optional environment if the Worker utilizes one.

namespace: Optional[str]

Optional dispatch namespace the script belongs to.

usage_model: Optional[Literal["standard", "bundled", "unbound"]]

Usage model for the Worker invocations.

One of the following:
"standard"
"bundled"
"unbound"

DispatchNamespacesScriptsBindings

Get Script Bindings
workers_for_platforms.dispatch.namespaces.scripts.bindings.get(strscript_name, BindingGetParams**kwargs) -> SyncSinglePage[BindingGetResponse]
GET/accounts/{account_id}/workers/dispatch/namespaces/{dispatch_namespace}/scripts/{script_name}/bindings
ModelsExpand Collapse

A binding to allow the Worker to communicate with resources.

One of the following:
class WorkersBindingKindAI:
name: str

A JavaScript variable name for the binding.

type: Literal["ai"]

The kind of resource that the binding provides.

class WorkersBindingKindAISearch:
instance_name: str

The user-chosen instance name. Must exist at deploy time. The worker can search, chat, update, and manage items/jobs on this instance.

name: str

A JavaScript variable name for the binding.

type: Literal["ai_search"]

The kind of resource that the binding provides.

namespace: Optional[str]

The namespace the instance belongs to. Defaults to “default” if omitted. Customers who don’t use namespaces can simply omit this field.

class WorkersBindingKindAISearchNamespace:
name: str

A JavaScript variable name for the binding.

namespace: str

The user-chosen namespace name. Must exist before deploy — Wrangler handles auto-creation on deploy failure (R2 bucket pattern). The “default” namespace is auto-created by config-api for new accounts. Grants full access (CRUD + search + chat) to all instances within the namespace.

type: Literal["ai_search_namespace"]

The kind of resource that the binding provides.

class WorkersBindingKindAnalyticsEngine:
dataset: str

The name of the dataset to bind to.

name: str

A JavaScript variable name for the binding.

type: Literal["analytics_engine"]

The kind of resource that the binding provides.

class WorkersBindingKindAssets:
name: str

A JavaScript variable name for the binding.

type: Literal["assets"]

The kind of resource that the binding provides.

class WorkersBindingKindBrowser:
name: str

A JavaScript variable name for the binding.

type: Literal["browser"]

The kind of resource that the binding provides.

class WorkersBindingKindD1:
database_id: str

Identifier of the D1 database to bind to.

name: str

A JavaScript variable name for the binding.

type: Literal["d1"]

The kind of resource that the binding provides.

Deprecatedid: Optional[str]

This property has been renamed to database_id.

Identifier of the D1 database to bind to.

class WorkersBindingKindDataBlob:
name: str

A JavaScript variable name for the binding.

part: str

The name of the file containing the data content. Only accepted for service worker syntax Workers.

Deprecatedtype: Literal["data_blob"]

The kind of resource that the binding provides.

class WorkersBindingKindDispatchNamespace:
name: str

A JavaScript variable name for the binding.

namespace: str

The name of the dispatch namespace.

type: Literal["dispatch_namespace"]

The kind of resource that the binding provides.

outbound: Optional[WorkersBindingKindDispatchNamespaceOutbound]

Outbound worker.

params: Optional[List[WorkersBindingKindDispatchNamespaceOutboundParam]]

Pass information from the Dispatch Worker to the Outbound Worker through the parameters.

name: str

Name of the parameter.

worker: Optional[WorkersBindingKindDispatchNamespaceOutboundWorker]

Outbound worker.

entrypoint: Optional[str]

Entrypoint to invoke on the outbound worker.

environment: Optional[str]

Environment of the outbound worker.

service: Optional[str]

Name of the outbound worker.

class WorkersBindingKindDurableObjectNamespace:
name: str

A JavaScript variable name for the binding.

type: Literal["durable_object_namespace"]

The kind of resource that the binding provides.

class_name: Optional[str]

The exported class name of the Durable Object.

dispatch_namespace: Optional[str]

The dispatch namespace the Durable Object script belongs to.

environment: Optional[str]

The environment of the script_name to bind to.

namespace_id: Optional[str]

Namespace identifier tag.

maxLength32
script_name: Optional[str]

The script where the Durable Object is defined, if it is external to this Worker.

class WorkersBindingKindHyperdrive:
id: str

Identifier of the Hyperdrive connection to bind to.

name: str

A JavaScript variable name for the binding.

type: Literal["hyperdrive"]

The kind of resource that the binding provides.

class WorkersBindingKindInherit:
name: str

The name of the inherited binding.

type: Literal["inherit"]

The kind of resource that the binding provides.

old_name: Optional[str]

The old name of the inherited binding. If set, the binding will be renamed from old_name to name in the new version. If not set, the binding will keep the same name between versions.

version_id: Optional[str]

Identifier for the version to inherit the binding from, which can be the version ID or the literal “latest” to inherit from the latest version. Defaults to inheriting the binding from the latest version.

class WorkersBindingKindImages:
name: str

A JavaScript variable name for the binding.

type: Literal["images"]

The kind of resource that the binding provides.

class WorkersBindingKindJson:
json: object

JSON data to use.

name: str

A JavaScript variable name for the binding.

type: Literal["json"]

The kind of resource that the binding provides.

class WorkersBindingKindKVNamespace:
name: str

A JavaScript variable name for the binding.

namespace_id: str

Namespace identifier tag.

maxLength32
type: Literal["kv_namespace"]

The kind of resource that the binding provides.

class WorkersBindingKindMedia:
name: str

A JavaScript variable name for the binding.

type: Literal["media"]

The kind of resource that the binding provides.

class WorkersBindingKindMTLSCertificate:
certificate_id: str

Identifier of the certificate to bind to.

name: str

A JavaScript variable name for the binding.

type: Literal["mtls_certificate"]

The kind of resource that the binding provides.

class WorkersBindingKindPlainText:
name: str

A JavaScript variable name for the binding.

text: str

The text value to use.

type: Literal["plain_text"]

The kind of resource that the binding provides.

class WorkersBindingKindPipelines:
name: str

A JavaScript variable name for the binding.

pipeline: str

Name of the Pipeline to bind to.

type: Literal["pipelines"]

The kind of resource that the binding provides.

class WorkersBindingKindQueue:
name: str

A JavaScript variable name for the binding.

queue_name: str

Name of the Queue to bind to.

type: Literal["queue"]

The kind of resource that the binding provides.

class WorkersBindingKindRatelimit:
name: str

A JavaScript variable name for the binding.

namespace_id: str

Identifier of the rate limit namespace to bind to.

simple: WorkersBindingKindRatelimitSimple

The rate limit configuration.

limit: float

The limit (requests per period).

period: int

The period in seconds.

mitigation_timeout: Optional[int]

Duration in seconds to apply the mitigation action after the rate limit is exceeded. Valid values are 0 (disabled), 10, or multiples of 60 up to 86400. Must be greater than or equal to the period when non-zero.

type: Literal["ratelimit"]

The kind of resource that the binding provides.

class WorkersBindingKindR2Bucket:
bucket_name: str

R2 bucket to bind to.

name: str

A JavaScript variable name for the binding.

type: Literal["r2_bucket"]

The kind of resource that the binding provides.

jurisdiction: Optional[Literal["eu", "fedramp", "fedramp-high"]]

The jurisdiction of the R2 bucket.

One of the following:
"eu"
"fedramp"
"fedramp-high"
class WorkersBindingKindSecretText:
name: str

A JavaScript variable name for the binding.

text: str

The secret value to use.

type: Literal["secret_text"]

The kind of resource that the binding provides.

class WorkersBindingKindSendEmail:
name: str

A JavaScript variable name for the binding.

type: Literal["send_email"]

The kind of resource that the binding provides.

allowed_destination_addresses: Optional[List[str]]

List of allowed destination addresses.

allowed_sender_addresses: Optional[List[str]]

List of allowed sender addresses.

destination_address: Optional[str]

Destination address for the email.

formatemail
class WorkersBindingKindService:
name: str

A JavaScript variable name for the binding.

service: str

Name of Worker to bind to.

type: Literal["service"]

The kind of resource that the binding provides.

entrypoint: Optional[str]

Entrypoint to invoke on the target Worker.

environment: Optional[str]

Optional environment if the Worker utilizes one.

class WorkersBindingKindTextBlob:
name: str

A JavaScript variable name for the binding.

part: str

The name of the file containing the text content. Only accepted for service worker syntax Workers.

Deprecatedtype: Literal["text_blob"]

The kind of resource that the binding provides.

class WorkersBindingKindVectorize:
index_name: str

Name of the Vectorize index to bind to.

name: str

A JavaScript variable name for the binding.

type: Literal["vectorize"]

The kind of resource that the binding provides.

class WorkersBindingKindVersionMetadata:
name: str

A JavaScript variable name for the binding.

type: Literal["version_metadata"]

The kind of resource that the binding provides.

class WorkersBindingKindSecretsStoreSecret:
name: str

A JavaScript variable name for the binding.

secret_name: str

Name of the secret in the store.

store_id: str

ID of the store containing the secret.

type: Literal["secrets_store_secret"]

The kind of resource that the binding provides.

class WorkersBindingKindFlagship:
app_id: str

ID of the Flagship app to bind to for feature flag evaluation.

maxLength128
name: str

A JavaScript variable name for the binding.

type: Literal["flagship"]

The kind of resource that the binding provides.

class WorkersBindingKindSecretKey:
algorithm: object

Algorithm-specific key parameters. Learn more.

format: Literal["raw", "pkcs8", "spki", "jwk"]

Data format of the key. Learn more.

One of the following:
"raw"
"pkcs8"
"spki"
"jwk"
name: str

A JavaScript variable name for the binding.

type: Literal["secret_key"]

The kind of resource that the binding provides.

usages: List[Literal["encrypt", "decrypt", "sign", 5 more]]

Allowed operations with the key. Learn more.

One of the following:
"encrypt"
"decrypt"
"sign"
"verify"
"deriveKey"
"deriveBits"
"wrapKey"
"unwrapKey"
key_base64: Optional[str]

Base64-encoded key data. Required if format is “raw”, “pkcs8”, or “spki”.

key_jwk: Optional[object]

Key data in JSON Web Key format. Required if format is “jwk”.

class WorkersBindingKindWorkflow:
name: str

A JavaScript variable name for the binding.

type: Literal["workflow"]

The kind of resource that the binding provides.

workflow_name: str

Name of the Workflow to bind to.

class_name: Optional[str]

Class name of the Workflow. Should only be provided if the Workflow belongs to this script.

script_name: Optional[str]

Script name that contains the Workflow. If not provided, defaults to this script name.

class WorkersBindingKindWasmModule:
name: str

A JavaScript variable name for the binding.

part: str

The name of the file containing the WebAssembly module content. Only accepted for service worker syntax Workers.

Deprecatedtype: Literal["wasm_module"]

The kind of resource that the binding provides.

class WorkersBindingKindVPCService:
name: str

A JavaScript variable name for the binding.

service_id: str

Identifier of the VPC service to bind to.

type: Literal["vpc_service"]

The kind of resource that the binding provides.

class WorkersBindingKindVPCNetwork:
name: str

A JavaScript variable name for the binding.

type: Literal["vpc_network"]

The kind of resource that the binding provides.

network_id: Optional[str]

Identifier of the network to bind to. Only “cf1:network” is currently supported. Mutually exclusive with tunnel_id.

tunnel_id: Optional[str]

UUID of the Cloudflare Tunnel to bind to. Mutually exclusive with network_id.

DispatchNamespacesScriptsSecrets

List Script Secrets
workers_for_platforms.dispatch.namespaces.scripts.secrets.list(strscript_name, SecretListParams**kwargs) -> SyncSinglePage[SecretListResponse]
GET/accounts/{account_id}/workers/dispatch/namespaces/{dispatch_namespace}/scripts/{script_name}/secrets
Get secret binding
workers_for_platforms.dispatch.namespaces.scripts.secrets.get(strsecret_name, SecretGetParams**kwargs) -> SecretGetResponse
GET/accounts/{account_id}/workers/dispatch/namespaces/{dispatch_namespace}/scripts/{script_name}/secrets/{secret_name}
Add script secret
workers_for_platforms.dispatch.namespaces.scripts.secrets.update(strscript_name, SecretUpdateParams**kwargs) -> SecretUpdateResponse
PUT/accounts/{account_id}/workers/dispatch/namespaces/{dispatch_namespace}/scripts/{script_name}/secrets
Delete script secret
workers_for_platforms.dispatch.namespaces.scripts.secrets.delete(strsecret_name, SecretDeleteParams**kwargs) -> object
DELETE/accounts/{account_id}/workers/dispatch/namespaces/{dispatch_namespace}/scripts/{script_name}/secrets/{secret_name}
Patch multiple script secrets
workers_for_platforms.dispatch.namespaces.scripts.secrets.bulk_update(strscript_name, SecretBulkUpdateParams**kwargs) -> SecretBulkUpdateResponse
PATCH/accounts/{account_id}/workers/dispatch/namespaces/{dispatch_namespace}/scripts/{script_name}/secrets-bulk
ModelsExpand Collapse

A secret value accessible through a binding.

One of the following:
class WorkersBindingKindSecretText:
name: str

A JavaScript variable name for the binding.

text: str

The secret value to use.

type: Literal["secret_text"]

The kind of resource that the binding provides.

class WorkersBindingKindSecretKey:
algorithm: object

Algorithm-specific key parameters. Learn more.

format: Literal["raw", "pkcs8", "spki", "jwk"]

Data format of the key. Learn more.

One of the following:
"raw"
"pkcs8"
"spki"
"jwk"
name: str

A JavaScript variable name for the binding.

type: Literal["secret_key"]

The kind of resource that the binding provides.

usages: List[Literal["encrypt", "decrypt", "sign", 5 more]]

Allowed operations with the key. Learn more.

One of the following:
"encrypt"
"decrypt"
"sign"
"verify"
"deriveKey"
"deriveBits"
"wrapKey"
"unwrapKey"
key_base64: Optional[str]

Base64-encoded key data. Required if format is “raw”, “pkcs8”, or “spki”.

key_jwk: Optional[object]

Key data in JSON Web Key format. Required if format is “jwk”.

A secret value accessible through a binding.

One of the following:
class WorkersBindingKindSecretText:
name: str

A JavaScript variable name for the binding.

text: str

The secret value to use.

type: Literal["secret_text"]

The kind of resource that the binding provides.

class WorkersBindingKindSecretKey:
algorithm: object

Algorithm-specific key parameters. Learn more.

format: Literal["raw", "pkcs8", "spki", "jwk"]

Data format of the key. Learn more.

One of the following:
"raw"
"pkcs8"
"spki"
"jwk"
name: str

A JavaScript variable name for the binding.

type: Literal["secret_key"]

The kind of resource that the binding provides.

usages: List[Literal["encrypt", "decrypt", "sign", 5 more]]

Allowed operations with the key. Learn more.

One of the following:
"encrypt"
"decrypt"
"sign"
"verify"
"deriveKey"
"deriveBits"
"wrapKey"
"unwrapKey"
key_base64: Optional[str]

Base64-encoded key data. Required if format is “raw”, “pkcs8”, or “spki”.

key_jwk: Optional[object]

Key data in JSON Web Key format. Required if format is “jwk”.

A secret value accessible through a binding.

One of the following:
class WorkersBindingKindSecretText:
name: str

A JavaScript variable name for the binding.

text: str

The secret value to use.

type: Literal["secret_text"]

The kind of resource that the binding provides.

class WorkersBindingKindSecretKey:
algorithm: object

Algorithm-specific key parameters. Learn more.

format: Literal["raw", "pkcs8", "spki", "jwk"]

Data format of the key. Learn more.

One of the following:
"raw"
"pkcs8"
"spki"
"jwk"
name: str

A JavaScript variable name for the binding.

type: Literal["secret_key"]

The kind of resource that the binding provides.

usages: List[Literal["encrypt", "decrypt", "sign", 5 more]]

Allowed operations with the key. Learn more.

One of the following:
"encrypt"
"decrypt"
"sign"
"verify"
"deriveKey"
"deriveBits"
"wrapKey"
"unwrapKey"
key_base64: Optional[str]

Base64-encoded key data. Required if format is “raw”, “pkcs8”, or “spki”.

key_jwk: Optional[object]

Key data in JSON Web Key format. Required if format is “jwk”.

Dict[str, SecretBulkUpdateResponseItem]

Map of secret names to secret metadata for resulting secrets.

One of the following:
class SecretBulkUpdateResponseItemWorkersBindingKindSecretText:
name: str

A JavaScript variable name for the binding.

text: str

The secret value to use.

type: Literal["secret_text"]

The kind of resource that the binding provides.

class SecretBulkUpdateResponseItemWorkersBindingKindSecretKey:
algorithm: object

Algorithm-specific key parameters. Learn more.

format: Literal["raw", "pkcs8", "spki", "jwk"]

Data format of the key. Learn more.

One of the following:
"raw"
"pkcs8"
"spki"
"jwk"
name: str

A JavaScript variable name for the binding.

type: Literal["secret_key"]

The kind of resource that the binding provides.

usages: List[Literal["encrypt", "decrypt", "sign", 5 more]]

Allowed operations with the key. Learn more.

One of the following:
"encrypt"
"decrypt"
"sign"
"verify"
"deriveKey"
"deriveBits"
"wrapKey"
"unwrapKey"
key_base64: Optional[str]

Base64-encoded key data. Required if format is “raw”, “pkcs8”, or “spki”.

key_jwk: Optional[object]

Key data in JSON Web Key format. Required if format is “jwk”.

DispatchNamespacesScriptsTags

Get Script Tags
workers_for_platforms.dispatch.namespaces.scripts.tags.list(strscript_name, TagListParams**kwargs) -> SyncSinglePage[TagListResponse]
GET/accounts/{account_id}/workers/dispatch/namespaces/{dispatch_namespace}/scripts/{script_name}/tags
Put Script Tags
workers_for_platforms.dispatch.namespaces.scripts.tags.update(strscript_name, TagUpdateParams**kwargs) -> SyncSinglePage[TagUpdateResponse]
PUT/accounts/{account_id}/workers/dispatch/namespaces/{dispatch_namespace}/scripts/{script_name}/tags
Delete Script Tag
workers_for_platforms.dispatch.namespaces.scripts.tags.delete(strtag, TagDeleteParams**kwargs) -> object
DELETE/accounts/{account_id}/workers/dispatch/namespaces/{dispatch_namespace}/scripts/{script_name}/tags/{tag}
ModelsExpand Collapse
str
str