Beta
BetaWorkers
List Workers
Get Worker
Create Worker
Update Worker
Edit Worker
Delete Worker
ModelsExpand Collapse
type Worker struct{…}
Observability WorkerObservabilityObservability settings for the Worker.
Observability settings for the Worker.
The sampling rate for observability. From 0 to 1 (1 = 100%, 0.1 = 10%).
Logs WorkerObservabilityLogsOptionalLog settings for the Worker.
Log settings for the Worker.
Whether invocation logs are enabled for the Worker.
Traces WorkerObservabilityTracesOptionalTrace settings for the Worker.
Trace settings for the Worker.
PropagationPolicy WorkerObservabilityTracesPropagationPolicyOptionalControls 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.
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.
References WorkerReferencesOther resources that reference the Worker and depend on it existing.
Other resources that reference the Worker and depend on it existing.
DispatchNamespaceOutbounds []WorkerReferencesDispatchNamespaceOutboundOther Workers that reference the Worker as an outbound for a dispatch namespace.
Other Workers that reference the Worker as an outbound for a dispatch namespace.
DurableObjects []WorkerReferencesDurableObjectOther Workers that reference Durable Object classes implemented by the Worker.
Other Workers that reference Durable Object classes implemented by the Worker.
Workers []WorkerReferencesWorkerOther Workers that reference the Worker using service bindings.
Other Workers that reference the Worker using service bindings.
Subdomain WorkerSubdomainSubdomain settings for the Worker.
Subdomain settings for the Worker.
Whether preview URLs are enabled for the Worker.
BetaWorkersVersions
List Versions
Get Version
Create Version
Delete Version
ModelsExpand Collapse
type Version struct{…}
All routable URLs that always point to this version. Does not include alias URLs, since aliases can be updated to point to a different version.
Annotations VersionAnnotationsOptionalMetadata about the version.
Metadata about the version.
Assets VersionAssetsOptionalConfiguration for assets within a Worker.
_headers and
_redirects files should be
included as modules named _headers and _redirects with content type text/plain.
Configuration for assets within a Worker.
_headers and
_redirects files should be
included as modules named _headers and _redirects with content type text/plain.
Config VersionAssetsConfigOptionalConfiguration for assets within a Worker.
Configuration for assets within a Worker.
HTMLHandling VersionAssetsConfigHTMLHandlingOptionalDetermines the redirects and rewrites of requests for HTML content.
Determines the redirects and rewrites of requests for HTML content.
NotFoundHandling VersionAssetsConfigNotFoundHandlingOptionalDetermines the response when a request does not match a static asset, and there is no Worker script.
Determines the response when a request does not match a static asset, and there is no Worker script.
RunWorkerFirst VersionAssetsConfigRunWorkerFirstUnionOptionalContains a list path rules to control routing to either the Worker or assets. Glob (*) and negative (!) rules are supported. Rules must start with either ’/’ or ’!/’. At least one non-negative rule must be provided, and negative rules have higher precedence than non-negative rules.
Contains a list path rules to control routing to either the Worker or assets. Glob (*) and negative (!) rules are supported. Rules must start with either ’/’ or ’!/’. At least one non-negative rule must be provided, and negative rules have higher precedence than non-negative rules.
Contains a list path rules to control routing to either the Worker or assets. Glob (*) and negative (!) rules are supported. Rules must start with either ’/’ or ’!/’. At least one non-negative rule must be provided, and negative rules have higher precedence than non-negative rules.
Bindings []VersionBindingOptionalList 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.
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.
type VersionBindingsWorkersBindingKindAISearch struct{…}
type VersionBindingsWorkersBindingKindAISearchNamespace struct{…}
type VersionBindingsWorkersBindingKindDispatchNamespace struct{…}
The kind of resource that the binding provides.
type VersionBindingsWorkersBindingKindDurableObjectNamespace struct{…}
type VersionBindingsWorkersBindingKindInherit struct{…}
type VersionBindingsWorkersBindingKindRatelimit struct{…}
type VersionBindingsWorkersBindingKindR2Bucket struct{…}
Jurisdiction VersionBindingsWorkersBindingKindR2BucketJurisdictionOptionalThe jurisdiction of the R2 bucket.
The jurisdiction of the R2 bucket.
type VersionBindingsWorkersBindingKindSecretKey struct{…}
Algorithm-specific key parameters. Learn more.
Format VersionBindingsWorkersBindingKindSecretKeyFormatData format of the key. Learn more.
Data format of the key. Learn more.
Usages []VersionBindingsWorkersBindingKindSecretKeyUsageAllowed operations with the key. Learn more.
Allowed operations with the key. Learn more.
Key data in JSON Web Key format. Required if format is “jwk”.
type VersionBindingsWorkersBindingKindWorkflow struct{…}
CacheOptions VersionCacheOptionsOptionalGlobal 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.
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.
Date indicating targeted support in the Workers runtime. Backwards incompatible fixes to the runtime following this date will not affect this Worker.
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.
Containers []VersionContainerOptionalList of containers attached to a Worker. Containers can only be attached to Durable Object classes of this Worker script.
List of containers attached to a Worker. Containers can only be attached to Durable Object classes of this Worker script.
Exports map[string, VersionExport]OptionalDeclarative exports for the version, including Durable Object
classes (with their storage backend) and named Worker
entrypoints. On reads, tombstoned lifecycle entries are
omitted, so only live exports (created and
expecting-transfer) are returned. exports and migrations
are mutually exclusive on upload.
Declarative exports for the version, including Durable Object
classes (with their storage backend) and named Worker
entrypoints. On reads, tombstoned lifecycle entries are
omitted, so only live exports (created and
expecting-transfer) are returned. exports and migrations
are mutually exclusive on upload.
type VersionExportsWorkersWorkerExport struct{…}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.
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 VersionExportsWorkersDurableObjectExport struct{…}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.
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 VersionExportsWorkersDurableObjectExportStorageDurable 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.
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.
type VersionExportsWorkersDurableObjectDeletedExport struct{…}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.
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.
type VersionExportsWorkersDurableObjectRenamedExport struct{…}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.
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.
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.
type VersionExportsWorkersDurableObjectTransferredExport struct{…}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.
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.
Tombstone that transfers the namespace to another script.
type VersionExportsWorkersDurableObjectExpectingTransferExport struct{…}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.
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.
Target side of a two-phase transfer.
Storage VersionExportsWorkersDurableObjectExpectingTransferExportStorageDurable 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.
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.
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.
ExportsReconciliation VersionExportsReconciliationOptionalSummary 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.
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.
Info []VersionExportsReconciliationInfoNon-blocking info entries (stale tombstones, tombstone applied
with class still in code). See exports_reconciliation_info.
Non-blocking info entries (stale tombstones, tombstone applied
with class still in code). See exports_reconciliation_info.
Scenario VersionExportsReconciliationInfoScenarioStable, machine-readable tag identifying which reconciliation
scenario produced an error, warning, or info entry. Clients may
branch on this value instead of parsing message.
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.
Source class names whose tombstone entry is now stale and safe
to delete from exports (no remaining referencing scripts).
TransferPending []VersionExportsReconciliationTransferPendingPhase-1 transfer hints recorded on the target side.
Phase-1 transfer hints recorded on the target side.
Warnings []VersionExportsReconciliationWarningNon-blocking warnings. See exports_reconciliation_warning.
Non-blocking warnings. See exports_reconciliation_warning.
Scenario VersionExportsReconciliationWarningsScenarioStable, machine-readable tag identifying which reconciliation
scenario produced an error, warning, or info entry. Clients may
branch on this value instead of parsing message.
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.
The name of the main module in the modules array (e.g. the name of the module that exports a fetch handler).
Durable Object migration tag. Set when the version is deployed. Omitted if the version has not been deployed or the Worker does not use Durable Objects.
Migrations VersionMigrationsOptionalMigrations for Durable Objects associated with the version. Migrations are applied when the version is deployed.
Migrations for Durable Objects associated with the version. Migrations are applied when the version is deployed.
type SingleStepMigration struct{…}A single set of migrations to apply.
A single set of migrations to apply.
A list of classes to create Durable Object namespaces with SQLite from.
Tag used to verify against the latest migration tag for this Worker. If they don’t match, the upload is rejected.
type VersionMigrationsWorkersMultipleStepMigrations struct{…}
Tag used to verify against the latest migration tag for this Worker. If they don’t match, the upload is rejected.
Modules []VersionModuleOptionalCode, sourcemaps, and other content used at runtime.
This includes _headers and
_redirects files used to configure
Static Assets. _headers and _redirects files should be
included as modules named _headers and _redirects with content type text/plain.
Code, sourcemaps, and other content used at runtime.
This includes _headers and
_redirects files used to configure
Static Assets. _headers and _redirects files should be
included as modules named _headers and _redirects with content type text/plain.
PackageDependencies []VersionPackageDependencyOptionalThe list of npm packages that were installed and used when this Worker
version was built.
The list of npm packages that were installed and used when this Worker version was built.
Placement VersionPlacementOptionalConfiguration for Smart Placement. Specify mode=‘smart’ for Smart Placement, or one of region/hostname/host.
Configuration for Smart Placement. Specify mode=‘smart’ for Smart Placement, or one of region/hostname/host.
type VersionPlacementMode struct{…}
Enables Smart Placement.
Time in milliseconds spent on Worker startup.