workers_invocations
Analytics resource
This is a time-bounded analytics resource. Queries against it differ from typical CRUD resources in a few ways:
sinceanduntilare 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. Thelimitparameter (default100) bounds the response. Widen the time window or raiselimitto 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
| Name | workers_invocations |
| Type | Resource |
| Id | cloudflare.workers.workers_invocations |
Fields
The following fields are returned by SELECT queries:
- list
Response
| Name | Datatype | Description |
|---|---|---|
script_name | string | Worker script name. |
colo_code | string | IATA airport code of the serving colo. |
cpu_time_us | integer | Total CPU time in microseconds. |
datetime | string (date-time) | |
duration_gb_s | integer | Billable duration (GB*s units). |
errors | integer | Errored invocations. |
requests | integer | Invocation count. |
response_body_size | integer | Total response body bytes. |
status | string | Invocation status (success / clientDisconnected / scriptError / etc.). |
subrequests | integer | Subrequest count. |
usage_model | string | Usage model (bundled / unbound / etc.). |
wall_time_us | integer | Total wall time in microseconds. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list | select | account_tag, since, until | limit | 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. |
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.
| Name | Datatype | Description |
|---|---|---|
account_tag | string | Cloudflare account ID (the 32-char hex tag). |
since | string (date-time) | Lower bound (inclusive). RFC3339. |
until | string (date-time) | Upper bound (exclusive). RFC3339. |
limit | integer | Maximum dimension-tuple rows per call. |
SELECT examples
- list
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 }}'
;