Skip to main content

scripts_versions

Creates, updates, deletes, gets or lists a scripts_versions resource.

Overview

Namescripts_versions
TypeResource
Idcloudflare.workers.scripts_versions

Fields

The following fields are returned by SELECT queries:

Get Version Detail response.

NameDatatypeDescription
idstringUnique identifier for the version. (example: 18f97339-c287-4872-9bdd-e2135c07ec12)
metadataobject
numbernumberSequential version number.
resourcesobject

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_by_accountselectaccount_id, script_name, version_idRetrieves detailed information about a specific version of a Workers script.
list_by_accountselectaccount_id, script_namedeployable, page, per_pageList of Worker Versions. The first version in the list is the latest version.
create_by_accountinsertaccount_id, script_name, metadatabindings_inheritUpload a Worker Version without deploying to Cloudflare's network. You can find more about the multipart metadata on our docs: https://developers.cloudflare.com/workers/configuration/multipart-upload-metadata/.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
account_idstringThe Cloudflare account ID.
script_namestringThe Worker script name.
version_idstring
bindings_inheritstringWhen set to "strict", the upload will fail if any inherit type bindings cannot be resolved against the previous version of the Worker. Without this, unresolvable inherit bindings are silently dropped.
deployablebooleanOnly return versions that can be used in a deployment. Ignores pagination.
pageintegerCurrent page.
per_pageintegerItems per-page.

SELECT examples

Retrieves detailed information about a specific version of a Workers script.

SELECT
id,
metadata,
number,
resources
FROM cloudflare.workers.scripts_versions
WHERE account_id = '{{ account_id }}' -- required
AND script_name = '{{ script_name }}' -- required
AND version_id = '{{ version_id }}' -- required
;

INSERT examples

Upload a Worker Version without deploying to Cloudflare's network. You can find more about the multipart metadata on our docs: https://developers.cloudflare.com/workers/configuration/multipart-upload-metadata/.

INSERT INTO cloudflare.workers.scripts_versions (
files,
metadata,
account_id,
script_name,
bindings_inherit
)
SELECT
'{{ files }}',
'{{ metadata }}' /* required */,
'{{ account_id }}',
'{{ script_name }}',
'{{ bindings_inherit }}'
RETURNING
errors,
messages,
result,
success
;