Skip to main content

workers_invocations

Analytics resource

This is a time-bounded analytics resource. Queries against it differ from typical CRUD resources in a few ways:

  • since and until are required. Both are RFC3339 timestamps and define the analytics window (e.g. since = '2026-05-28T00:00:00Z', until = '2026-05-29T00:00:00Z'). Queries without them will fail.
  • Row cap via limit. The limit parameter (default 100) bounds the response. Widen the time window or raise limit to return more rows.
  • Token scope. Cloudflare's analytics endpoints require an API token with Account -> Analytics -> Read permission, which is broader than typical zone-scoped tokens. A token without it will return empty results.

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

Overview

Nameworkers_invocations
TypeResource
Idcloudflare.workers.workers_invocations

Fields

The following fields are returned by SELECT queries:

Response

NameDatatypeDescription
script_namestringWorker script name.
colo_codestringIATA airport code of the serving colo.
cpu_time_usintegerTotal CPU time in microseconds.
datetimestring (date-time)
duration_gb_sintegerBillable duration (GB*s units).
errorsintegerErrored invocations.
requestsintegerInvocation count.
response_body_sizeintegerTotal response body bytes.
statusstringInvocation status (success / clientDisconnected / scriptError / etc.).
subrequestsintegerSubrequest count.
usage_modelstringUsage model (bundled / unbound / etc.).
wall_time_usintegerTotal wall time in microseconds.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectaccount_tag, since, untillimitCloudflare Workers invocation analytics for an account, grouped by script, status, and serving colo. Per-tuple totals for requests, errors, CPU time, duration (GB-s), subrequests, and response bytes.

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_tagstringCloudflare account ID (the 32-char hex tag).
sincestring (date-time)Lower bound (inclusive). RFC3339.
untilstring (date-time)Upper bound (exclusive). RFC3339.
limitintegerMaximum dimension-tuple rows per call.

SELECT examples

Cloudflare Workers invocation analytics for an account, grouped by script, status, and serving colo. Per-tuple totals for requests, errors, CPU time, duration (GB-s), subrequests, and response bytes.

SELECT
script_name,
colo_code,
cpu_time_us,
datetime,
duration_gb_s,
errors,
requests,
response_body_size,
status,
subrequests,
usage_model,
wall_time_us
FROM cloudflare.workers.workers_invocations
WHERE account_tag = '{{ account_tag }}' -- required
AND since = '{{ since }}' -- required
AND until = '{{ until }}' -- required
AND limit = '{{ limit }}'
;