## List Workers `client.workers.scripts.list(ScriptListParamsparams, RequestOptionsoptions?): SinglePage` **get** `/accounts/{account_id}/workers/scripts` Fetch a list of uploaded workers. ### Parameters - `params: ScriptListParams` - `account_id: string` Path param: Identifier. - `tags?: string` Query param: Filter scripts by tags. Format: comma-separated list of tag:allowed pairs where allowed is 'yes' or 'no'. ### Returns - `ScriptListResponse` - `id?: string` The name used to identify the script. - `compatibility_date?: string` Date indicating targeted support in the Workers runtime. Backwards incompatible fixes to the runtime following this date will not affect this Worker. - `compatibility_flags?: Array` 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?: string` When the script was created. - `etag?: string` Hashed script content, can be used in a If-None-Match header when updating. - `handlers?: Array` The names of handlers exported as part of the default export. - `has_assets?: boolean` Whether a Worker contains assets. - `has_modules?: boolean` Whether a Worker contains modules. - `last_deployed_from?: string` The client most recently used to deploy this Worker. - `logpush?: boolean` Whether Logpush is turned on for the Worker. - `migration_tag?: string` The tag of the Durable Object migration that was most recently applied for this Worker. - `modified_on?: string` When the script was last modified. - `named_handlers?: Array` Named exports, such as Durable Object class implementations and named entrypoints. - `handlers?: Array` The names of handlers exported as part of the named export. - `name?: string` The name of the export. - `observability?: Observability` Observability settings for the Worker. - `enabled: boolean` Whether observability is enabled for the Worker. - `head_sampling_rate?: number | null` The sampling rate for incoming requests. From 0 to 1 (1 = 100%, 0.1 = 10%). Default is 1. - `logs?: Logs | null` Log settings for the Worker. - `enabled: boolean` Whether logs are enabled for the Worker. - `invocation_logs: boolean` Whether [invocation logs](https://developers.cloudflare.com/workers/observability/logs/workers-logs/#invocation-logs) are enabled for the Worker. - `destinations?: Array` A list of destinations where logs will be exported to. - `head_sampling_rate?: number | null` The sampling rate for logs. From 0 to 1 (1 = 100%, 0.1 = 10%). Default is 1. - `persist?: boolean` Whether log persistence is enabled for the Worker. - `traces?: Traces | null` Trace settings for the Worker. - `destinations?: Array` A list of destinations where traces will be exported to. - `enabled?: boolean` Whether traces are enabled for the Worker. - `head_sampling_rate?: number | null` The sampling rate for traces. From 0 to 1 (1 = 100%, 0.1 = 10%). Default is 1. - `persist?: boolean` Whether trace persistence is enabled for the Worker. - `placement?: UnionMember0 | UnionMember1 | UnionMember2 | 5 more` Configuration for [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). Specify mode='smart' for Smart Placement, or one of region/hostname/host. - `UnionMember0` - `mode: "smart"` Enables [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). - `"smart"` - `last_analyzed_at?: string` The last time the script was analyzed for [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). - `status?: "SUCCESS" | "UNSUPPORTED_APPLICATION" | "INSUFFICIENT_INVOCATIONS"` Status of [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). - `"SUCCESS"` - `"UNSUPPORTED_APPLICATION"` - `"INSUFFICIENT_INVOCATIONS"` - `UnionMember1` - `region: string` Cloud region for targeted placement in format 'provider:region'. - `last_analyzed_at?: string` The last time the script was analyzed for [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). - `status?: "SUCCESS" | "UNSUPPORTED_APPLICATION" | "INSUFFICIENT_INVOCATIONS"` Status of [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). - `"SUCCESS"` - `"UNSUPPORTED_APPLICATION"` - `"INSUFFICIENT_INVOCATIONS"` - `UnionMember2` - `hostname: string` HTTP hostname for targeted placement. - `last_analyzed_at?: string` The last time the script was analyzed for [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). - `status?: "SUCCESS" | "UNSUPPORTED_APPLICATION" | "INSUFFICIENT_INVOCATIONS"` Status of [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). - `"SUCCESS"` - `"UNSUPPORTED_APPLICATION"` - `"INSUFFICIENT_INVOCATIONS"` - `UnionMember3` - `host: string` TCP host and port for targeted placement. - `last_analyzed_at?: string` The last time the script was analyzed for [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). - `status?: "SUCCESS" | "UNSUPPORTED_APPLICATION" | "INSUFFICIENT_INVOCATIONS"` Status of [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). - `"SUCCESS"` - `"UNSUPPORTED_APPLICATION"` - `"INSUFFICIENT_INVOCATIONS"` - `UnionMember4` - `mode: "targeted"` Targeted placement mode. - `"targeted"` - `region: string` Cloud region for targeted placement in format 'provider:region'. - `last_analyzed_at?: string` The last time the script was analyzed for [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). - `status?: "SUCCESS" | "UNSUPPORTED_APPLICATION" | "INSUFFICIENT_INVOCATIONS"` Status of [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). - `"SUCCESS"` - `"UNSUPPORTED_APPLICATION"` - `"INSUFFICIENT_INVOCATIONS"` - `UnionMember5` - `hostname: string` HTTP hostname for targeted placement. - `mode: "targeted"` Targeted placement mode. - `"targeted"` - `last_analyzed_at?: string` The last time the script was analyzed for [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). - `status?: "SUCCESS" | "UNSUPPORTED_APPLICATION" | "INSUFFICIENT_INVOCATIONS"` Status of [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). - `"SUCCESS"` - `"UNSUPPORTED_APPLICATION"` - `"INSUFFICIENT_INVOCATIONS"` - `UnionMember6` - `host: string` TCP host and port for targeted placement. - `mode: "targeted"` Targeted placement mode. - `"targeted"` - `last_analyzed_at?: string` The last time the script was analyzed for [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). - `status?: "SUCCESS" | "UNSUPPORTED_APPLICATION" | "INSUFFICIENT_INVOCATIONS"` Status of [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). - `"SUCCESS"` - `"UNSUPPORTED_APPLICATION"` - `"INSUFFICIENT_INVOCATIONS"` - `UnionMember7` - `mode: "targeted"` Targeted placement mode. - `"targeted"` - `target: Array` Array of placement targets (currently limited to single target). - `Region` - `region: string` Cloud region in format 'provider:region'. - `Hostname` - `hostname: string` HTTP hostname for targeted placement. - `Host` - `host: string` TCP host:port for targeted placement. - `last_analyzed_at?: string` The last time the script was analyzed for [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). - `status?: "SUCCESS" | "UNSUPPORTED_APPLICATION" | "INSUFFICIENT_INVOCATIONS"` Status of [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement). - `"SUCCESS"` - `"UNSUPPORTED_APPLICATION"` - `"INSUFFICIENT_INVOCATIONS"` - `placement_mode?: "smart" | "targeted"` - `"smart"` - `"targeted"` - `placement_status?: "SUCCESS" | "UNSUPPORTED_APPLICATION" | "INSUFFICIENT_INVOCATIONS"` - `"SUCCESS"` - `"UNSUPPORTED_APPLICATION"` - `"INSUFFICIENT_INVOCATIONS"` - `routes?: Array | null` Routes associated with the Worker. - `id: string` Identifier. - `pattern: string` Pattern to match incoming requests against. [Learn more](https://developers.cloudflare.com/workers/configuration/routing/routes/#matching-behavior). - `script?: string` Name of the script to run if the route matches. - `tag?: string` The immutable ID of the script. - `tags?: Array | null` Tags associated with the Worker. - `tail_consumers?: Array | null` List of Workers that will consume logs from the attached Worker. - `service: string` Name of Worker that is to be the consumer. - `environment?: string` Optional environment if the Worker utilizes one. - `namespace?: string` Optional dispatch namespace the script belongs to. - `usage_model?: "standard" | "bundled" | "unbound"` Usage model for the Worker invocations. - `"standard"` - `"bundled"` - `"unbound"` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); // Automatically fetches more pages as needed. for await (const scriptListResponse of client.workers.scripts.list({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', })) { console.log(scriptListResponse.id); } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": [ { "id": "my-workers-script", "compatibility_date": "2021-01-01", "compatibility_flags": [ "nodejs_compat" ], "created_on": "2017-01-01T00:00:00Z", "etag": "ea95132c15732412d22c1476fa83f27a", "handlers": [ "fetch", "scheduled" ], "has_assets": false, "has_modules": false, "last_deployed_from": "wrangler", "logpush": false, "migration_tag": "v1", "modified_on": "2017-01-01T00:00:00Z", "named_handlers": [ { "handlers": [ "class" ], "name": "MyDurableObject" } ], "observability": { "enabled": true, "head_sampling_rate": 0.1, "logs": { "enabled": true, "invocation_logs": true, "destinations": [ "cloudflare" ], "head_sampling_rate": 0.1, "persist": true }, "traces": { "destinations": [ "cloudflare" ], "enabled": true, "head_sampling_rate": 0.1, "persist": true } }, "placement": { "mode": "smart", "last_analyzed_at": "2025-01-01T00:00:00Z", "status": "SUCCESS" }, "placement_mode": "smart", "placement_status": "SUCCESS", "routes": [ { "id": "023e105f4ecef8ad9ca31a8372d0c353", "pattern": "example.com/*", "script": "my-workers-script" } ], "tag": "e8f70fdbc8b1fb0b8ddb1af166186758", "tags": [ "my-team", "my-public-api" ], "tail_consumers": [ { "service": "my-log-consumer", "environment": "production", "namespace": "my-namespace" } ], "usage_model": "standard" } ], "success": true } ```