From 2abe2ea2635008f94ebffcddbfdca21512bf29b5 Mon Sep 17 00:00:00 2001 From: tmo Date: Tue, 22 Sep 2026 18:09:25 +0100 Subject: [PATCH 1/8] Updated to include cron triggers in local explorer. --- ...026-09-22-local-explorer-cron-triggers.mdx | 29 +++++++++++++++ .../workers/configuration/cron-triggers.mdx | 23 +++++++++++- .../local-development/local-explorer.mdx | 36 +++++++++++++++++-- .../runtime-apis/handlers/scheduled.mdx | 4 ++- 4 files changed, 88 insertions(+), 4 deletions(-) create mode 100644 src/content/changelog/workers/2026-09-22-local-explorer-cron-triggers.mdx diff --git a/src/content/changelog/workers/2026-09-22-local-explorer-cron-triggers.mdx b/src/content/changelog/workers/2026-09-22-local-explorer-cron-triggers.mdx new file mode 100644 index 00000000000..0998aeea343 --- /dev/null +++ b/src/content/changelog/workers/2026-09-22-local-explorer-cron-triggers.mdx @@ -0,0 +1,29 @@ +--- +title: Test Cron Triggers with Local Explorer +description: Local Explorer can invoke configured or ad hoc Cron Triggers with custom scheduled times during local development. +products: + - workers +date: 2026-09-22 +--- + +Local Explorer can now send one-off Cron Trigger invocations to the `scheduled()` handler for a Worker during local development. This removes the need to construct request URLs when testing handler behavior. + +The browser interface supports the following tasks: + +- Invoke configured cron expressions +- Build ad hoc expressions +- Set reusable scheduled times +- Inspect outcomes and `noRetry()` status + +Ad hoc triggers and scheduled time presets stay in your browser. They do not change your Wrangler configuration or deployed Cron Triggers. Full invocation logs and traces remain available in the Local Explorer **Observability** views. + +The Local Explorer API exposes the same operation for tools and AI agents. The request targets an exact Worker name and accepts a cron expression and optional scheduled time: + +```sh +curl -X POST \ + "http://localhost:8787/cdn-cgi/local/explorer/api/local/scheduled?worker=my-worker" \ + -H "Content-Type: application/json" \ + --data '{"cron":"0 * * * *","scheduled_time":1745856238000}' +``` + +For more details, refer to [Test Cron Triggers with Local Explorer](/workers/local-development/local-explorer/#test-cron-triggers). diff --git a/src/content/docs/workers/configuration/cron-triggers.mdx b/src/content/docs/workers/configuration/cron-triggers.mdx index 2b6f7525ddb..19685e1dab8 100644 --- a/src/content/docs/workers/configuration/cron-triggers.mdx +++ b/src/content/docs/workers/configuration/cron-triggers.mdx @@ -13,6 +13,7 @@ import { TabItem, Tabs, DashButton, + Steps, } from "~/components"; ## Background @@ -193,7 +194,27 @@ Some common time intervals that may be useful for setting up your Cron Trigger: ## Test Cron Triggers locally -Test Cron Triggers using Wrangler with [`wrangler dev`](/workers/wrangler/commands/general/#dev), or using the [Cloudflare Vite plugin](https://developers.cloudflare.com/workers/vite-plugin/). This exposes a `/cdn-cgi/local/scheduled` route, which can be used to test using an HTTP request. If you are using the Cloudflare Vite Plugin, ensure that you use the correct vite port for the following commands (Vite defaults to 5173). +Use [`wrangler dev`](/workers/wrangler/commands/general/#dev) or the [Cloudflare Vite plugin](/workers/vite-plugin/) to test Cron Triggers locally. You can use Local Explorer or send an HTTP request. + +Cron Trigger testing in Local Explorer requires Wrangler 4.137.0 or later, or Cloudflare Vite plugin 1.58.0 or later. + +### Use Local Explorer + +[Local Explorer](/workers/local-development/local-explorer/) displays the exact Cron Triggers configured for the active environment. It can also test ad hoc expressions without changing your configuration. + + +1. Start your local development server and open Local Explorer. +2. Select **Cron Triggers** > **Configured Crons**. +3. Select _Now_ or add a scheduled time preset. +4. Select **Trigger** next to the expression you want to test. +5. Review the handler outcome. Use **Observability** > **Traces** to inspect logs and traces. + + +To test an expression that is not configured, select **Cron Triggers** > **Ad-Hoc Triggers**. Ad hoc triggers stay in your browser and do not modify deployed Cron Triggers. + +### Use an HTTP request + +Your local development server exposes `/cdn-cgi/local/scheduled`. If you use the Cloudflare Vite plugin, send requests to your Vite port. Vite uses port `5173` by default. ```sh curl "http://localhost:8787/cdn-cgi/local/scheduled" diff --git a/src/content/docs/workers/local-development/local-explorer.mdx b/src/content/docs/workers/local-development/local-explorer.mdx index a987857a954..3725b90712c 100644 --- a/src/content/docs/workers/local-development/local-explorer.mdx +++ b/src/content/docs/workers/local-development/local-explorer.mdx @@ -4,7 +4,7 @@ title: Local Explorer sidebar: order: 5 head: [] -description: Browse and edit local binding data from your browser during development. +description: Browse and edit local binding data, and invoke email or scheduled handlers from your browser during development. products: - workers --- @@ -30,7 +30,7 @@ Local Explorer works with both [Wrangler](/workers/wrangler/) and the [Cloudflar 2. Open Local Explorer in your browser: - **Wrangler**: press `e` in your terminal. - - **Vite plugin**: navigate directly to `/cdn-cgi/local/explorer` on your dev server's route and port. + - **Vite plugin**: go directly to `/cdn-cgi/local/explorer` using your development server route and port. Local Explorer is available by default and detects the bindings defined in your [Wrangler configuration](/workers/wrangler/configuration/) automatically. @@ -60,6 +60,24 @@ Local Explorer also supports the following Worker triggers: For [D1](/d1/) databases and [Durable Objects](/durable-objects/) that use the [SQLite storage API](/durable-objects/api/sqlite-storage-api/), Local Explorer includes a SQL Studio. This is the same experience available in the Cloudflare dashboard for deployed D1 databases. It provides both a visual table browser with inline editing and a SQL query editor where you can run arbitrary queries. +## Test Cron Triggers + +Local Explorer can send one-off invocations to the [`scheduled()` handler](/workers/runtime-apis/handlers/scheduled/) for your Worker. Configure at least one [Cron Trigger](/workers/configuration/cron-triggers/) for the active environment before using this interface. + +Cron Trigger testing requires Wrangler 4.137.0 or later, or Cloudflare Vite plugin 1.58.0 or later. + + +1. In Local Explorer, select **Cron Triggers** > **Configured Crons**. +2. Under **Scheduled time**, select _Now_. To test another time, select **Add preset** and enter a UTC date and time or epoch milliseconds. +3. Select **Trigger** next to a configured cron expression. +4. Review the outcome and `noRetry()` status. To inspect logs and traces, select **Observability** > **Traces**. +5. (Optional) To test another expression, select **Cron Triggers** > **Ad-Hoc Triggers**. Select **Add trigger**, enter or build an expression, and then select **Trigger**. + + +Ad hoc triggers and scheduled time presets are stored in your browser. Local Explorer scopes them to the local project and Worker. They do not change your Wrangler configuration or deployed Cron Triggers. + +Each invocation is a one-off local test. Local development does not run Cron Triggers automatically. + ## Observability Local Explorer automatically captures traces and logs from every Worker invocation during `wrangler dev` without modifying your code. You get the same instrumentation as production [Workers Logs](/workers/observability/logs/workers-logs/) and [Traces](/workers/observability/traces/), including invocation logs, binding operations, timing, and console output, directly in your browser during development. @@ -88,6 +106,19 @@ To retrieve the OpenAPI spec: curl http://localhost:8787/cdn-cgi/local/explorer/api ``` +### Dispatch a scheduled invocation + +Send a `POST` request to `/local/scheduled` to invoke the `scheduled()` handler for a Worker. The `worker` query parameter must match the exact Worker name available to Local Explorer. + +```sh +curl -X POST \ + "http://localhost:8787/cdn-cgi/local/explorer/api/local/scheduled?worker=my-worker" \ + -H "Content-Type: application/json" \ + --data '{"cron":"0 * * * *","scheduled_time":1745856238000}' +``` + +The `cron` field is required. The optional `scheduled_time` field sets `controller.scheduledTime` with epoch milliseconds. The response includes the handler outcome and `noRetry()` status. + ### Use with AI agents When Wrangler or the Cloudflare Vite plugin detects it is running inside an AI agent, it prints a hint with the Local Explorer API endpoint directly to the terminal. The agent can fetch the [OpenAPI specification](https://www.openapis.org/) from that endpoint to discover all available operations, then make API calls to read or modify local data, query traces and logs, and debug your Worker. @@ -111,5 +142,6 @@ This can be useful as an alternative to the CLI when you want an agent to: - Populate test data in your local [KV](/kv/) namespaces or [D1](/d1/) databases - Inspect the state of a [Durable Object](/durable-objects/) during debugging - Trigger or retry a [Workflow](/workflows/) run with different input data +- Invoke a `scheduled()` handler with a chosen cron expression and time - Upload test files to a local [R2](/r2/) bucket - Find recent requests with errors and drill into failing spans diff --git a/src/content/docs/workers/runtime-apis/handlers/scheduled.mdx b/src/content/docs/workers/runtime-apis/handlers/scheduled.mdx index acb81542c1e..9158b7c1005 100644 --- a/src/content/docs/workers/runtime-apis/handlers/scheduled.mdx +++ b/src/content/docs/workers/runtime-apis/handlers/scheduled.mdx @@ -14,7 +14,9 @@ When a Worker is invoked via a [Cron Trigger](/workers/configuration/cron-trigge :::note[Testing scheduled() handlers in local development] -You can test the behavior of your `scheduled()` handler in local development by sending an HTTP request to `/cdn-cgi/local/scheduled` to trigger the handler. Pass `?format=json` to return the structured scheduled handler result. +Use [Local Explorer](/workers/local-development/local-explorer/#test-cron-triggers) to invoke your `scheduled()` handler with a configured or ad hoc cron expression. You can choose the scheduled time and inspect the structured result. + +For scripted tests, send an HTTP request to `/cdn-cgi/local/scheduled`. Pass `?format=json` to return the structured scheduled handler result. ```sh curl "http://localhost:8787/cdn-cgi/local/scheduled?format=json" From 65c85f1ecea171e9ffddf7e960a9748d1dc3b010 Mon Sep 17 00:00:00 2001 From: tmo Date: Thu, 24 Sep 2026 16:43:09 +0100 Subject: [PATCH 2/8] Address Local Explorer review feedback --- .../2026-09-22-local-explorer-cron-triggers.mdx | 2 +- .../local-development/local-explorer.mdx | 17 ++--------------- .../workers/runtime-apis/handlers/scheduled.mdx | 2 ++ 3 files changed, 5 insertions(+), 16 deletions(-) diff --git a/src/content/changelog/workers/2026-09-22-local-explorer-cron-triggers.mdx b/src/content/changelog/workers/2026-09-22-local-explorer-cron-triggers.mdx index 0998aeea343..7bcedfca797 100644 --- a/src/content/changelog/workers/2026-09-22-local-explorer-cron-triggers.mdx +++ b/src/content/changelog/workers/2026-09-22-local-explorer-cron-triggers.mdx @@ -3,7 +3,7 @@ title: Test Cron Triggers with Local Explorer description: Local Explorer can invoke configured or ad hoc Cron Triggers with custom scheduled times during local development. products: - workers -date: 2026-09-22 +date: 2026-09-24 --- Local Explorer can now send one-off Cron Trigger invocations to the `scheduled()` handler for a Worker during local development. This removes the need to construct request URLs when testing handler behavior. diff --git a/src/content/docs/workers/local-development/local-explorer.mdx b/src/content/docs/workers/local-development/local-explorer.mdx index 3725b90712c..4a7a7502b4f 100644 --- a/src/content/docs/workers/local-development/local-explorer.mdx +++ b/src/content/docs/workers/local-development/local-explorer.mdx @@ -4,7 +4,7 @@ title: Local Explorer sidebar: order: 5 head: [] -description: Browse and edit local binding data, and invoke email or scheduled handlers from your browser during development. +description: Browse and edit local binding data, and invoke scheduled handlers from your browser during development. products: - workers --- @@ -30,7 +30,7 @@ Local Explorer works with both [Wrangler](/workers/wrangler/) and the [Cloudflar 2. Open Local Explorer in your browser: - **Wrangler**: press `e` in your terminal. - - **Vite plugin**: go directly to `/cdn-cgi/local/explorer` using your development server route and port. + - **Vite plugin**: Navigate directly to `/cdn-cgi/local/explorer` on your dev server's route and port. Local Explorer is available by default and detects the bindings defined in your [Wrangler configuration](/workers/wrangler/configuration/) automatically. @@ -106,19 +106,6 @@ To retrieve the OpenAPI spec: curl http://localhost:8787/cdn-cgi/local/explorer/api ``` -### Dispatch a scheduled invocation - -Send a `POST` request to `/local/scheduled` to invoke the `scheduled()` handler for a Worker. The `worker` query parameter must match the exact Worker name available to Local Explorer. - -```sh -curl -X POST \ - "http://localhost:8787/cdn-cgi/local/explorer/api/local/scheduled?worker=my-worker" \ - -H "Content-Type: application/json" \ - --data '{"cron":"0 * * * *","scheduled_time":1745856238000}' -``` - -The `cron` field is required. The optional `scheduled_time` field sets `controller.scheduledTime` with epoch milliseconds. The response includes the handler outcome and `noRetry()` status. - ### Use with AI agents When Wrangler or the Cloudflare Vite plugin detects it is running inside an AI agent, it prints a hint with the Local Explorer API endpoint directly to the terminal. The agent can fetch the [OpenAPI specification](https://www.openapis.org/) from that endpoint to discover all available operations, then make API calls to read or modify local data, query traces and logs, and debug your Worker. diff --git a/src/content/docs/workers/runtime-apis/handlers/scheduled.mdx b/src/content/docs/workers/runtime-apis/handlers/scheduled.mdx index 9158b7c1005..5362385077c 100644 --- a/src/content/docs/workers/runtime-apis/handlers/scheduled.mdx +++ b/src/content/docs/workers/runtime-apis/handlers/scheduled.mdx @@ -16,6 +16,8 @@ When a Worker is invoked via a [Cron Trigger](/workers/configuration/cron-trigge Use [Local Explorer](/workers/local-development/local-explorer/#test-cron-triggers) to invoke your `scheduled()` handler with a configured or ad hoc cron expression. You can choose the scheduled time and inspect the structured result. +Cron Trigger testing requires Wrangler 4.137.0 or later, or Cloudflare Vite plugin 1.58.0 or later. Configure at least one Cron Trigger for the active environment. + For scripted tests, send an HTTP request to `/cdn-cgi/local/scheduled`. Pass `?format=json` to return the structured scheduled handler result. ```sh From a0fb2984c68c569107dbf0bd34607ef0770a7b34 Mon Sep 17 00:00:00 2001 From: tmo Date: Thu, 24 Sep 2026 16:44:59 +0100 Subject: [PATCH 3/8] Remove unreleased Local Explorer versions --- src/content/docs/workers/local-development/local-explorer.mdx | 2 -- src/content/docs/workers/runtime-apis/handlers/scheduled.mdx | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/content/docs/workers/local-development/local-explorer.mdx b/src/content/docs/workers/local-development/local-explorer.mdx index 4a7a7502b4f..2033529abb9 100644 --- a/src/content/docs/workers/local-development/local-explorer.mdx +++ b/src/content/docs/workers/local-development/local-explorer.mdx @@ -64,8 +64,6 @@ For [D1](/d1/) databases and [Durable Objects](/durable-objects/) that use the [ Local Explorer can send one-off invocations to the [`scheduled()` handler](/workers/runtime-apis/handlers/scheduled/) for your Worker. Configure at least one [Cron Trigger](/workers/configuration/cron-triggers/) for the active environment before using this interface. -Cron Trigger testing requires Wrangler 4.137.0 or later, or Cloudflare Vite plugin 1.58.0 or later. - 1. In Local Explorer, select **Cron Triggers** > **Configured Crons**. 2. Under **Scheduled time**, select _Now_. To test another time, select **Add preset** and enter a UTC date and time or epoch milliseconds. diff --git a/src/content/docs/workers/runtime-apis/handlers/scheduled.mdx b/src/content/docs/workers/runtime-apis/handlers/scheduled.mdx index 5362385077c..b952c97fbf7 100644 --- a/src/content/docs/workers/runtime-apis/handlers/scheduled.mdx +++ b/src/content/docs/workers/runtime-apis/handlers/scheduled.mdx @@ -16,7 +16,7 @@ When a Worker is invoked via a [Cron Trigger](/workers/configuration/cron-trigge Use [Local Explorer](/workers/local-development/local-explorer/#test-cron-triggers) to invoke your `scheduled()` handler with a configured or ad hoc cron expression. You can choose the scheduled time and inspect the structured result. -Cron Trigger testing requires Wrangler 4.137.0 or later, or Cloudflare Vite plugin 1.58.0 or later. Configure at least one Cron Trigger for the active environment. +Configure at least one Cron Trigger for the active environment before using this interface. For scripted tests, send an HTTP request to `/cdn-cgi/local/scheduled`. Pass `?format=json` to return the structured scheduled handler result. From f24c1affd317659d1f682fa74478014b28826622 Mon Sep 17 00:00:00 2001 From: tmo Date: Thu, 24 Sep 2026 16:53:56 +0100 Subject: [PATCH 4/8] Address feedback --- .../workers/2026-09-22-local-explorer-cron-triggers.mdx | 6 +++--- .../docs/workers/local-development/local-explorer.mdx | 2 ++ .../docs/workers/runtime-apis/handlers/scheduled.mdx | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/content/changelog/workers/2026-09-22-local-explorer-cron-triggers.mdx b/src/content/changelog/workers/2026-09-22-local-explorer-cron-triggers.mdx index 7bcedfca797..88d964120aa 100644 --- a/src/content/changelog/workers/2026-09-22-local-explorer-cron-triggers.mdx +++ b/src/content/changelog/workers/2026-09-22-local-explorer-cron-triggers.mdx @@ -6,16 +6,16 @@ products: date: 2026-09-24 --- -Local Explorer can now send one-off Cron Trigger invocations to the `scheduled()` handler for a Worker during local development. This removes the need to construct request URLs when testing handler behavior. +Local Explorer can now send one-off Cron Trigger invocations to a Worker's `scheduled()` handler during local development. This removes the need to construct request URLs when testing handler behavior. The browser interface supports the following tasks: - Invoke configured cron expressions -- Build ad hoc expressions +- Build ad-hoc expressions - Set reusable scheduled times - Inspect outcomes and `noRetry()` status -Ad hoc triggers and scheduled time presets stay in your browser. They do not change your Wrangler configuration or deployed Cron Triggers. Full invocation logs and traces remain available in the Local Explorer **Observability** views. +Ad-hoc triggers and scheduled time presets stay in your browser. They do not write to your Wrangler configuration or deployment. Full logs and traces remain available in the Local Explorer **Observability** views. The Local Explorer API exposes the same operation for tools and AI agents. The request targets an exact Worker name and accepts a cron expression and optional scheduled time: diff --git a/src/content/docs/workers/local-development/local-explorer.mdx b/src/content/docs/workers/local-development/local-explorer.mdx index 2033529abb9..2ee56366d48 100644 --- a/src/content/docs/workers/local-development/local-explorer.mdx +++ b/src/content/docs/workers/local-development/local-explorer.mdx @@ -64,6 +64,8 @@ For [D1](/d1/) databases and [Durable Objects](/durable-objects/) that use the [ Local Explorer can send one-off invocations to the [`scheduled()` handler](/workers/runtime-apis/handlers/scheduled/) for your Worker. Configure at least one [Cron Trigger](/workers/configuration/cron-triggers/) for the active environment before using this interface. +Cron Trigger testing requires Wrangler 4.139.0 or later, or Cloudflare Vite plugin 1.60.0 or later. + 1. In Local Explorer, select **Cron Triggers** > **Configured Crons**. 2. Under **Scheduled time**, select _Now_. To test another time, select **Add preset** and enter a UTC date and time or epoch milliseconds. diff --git a/src/content/docs/workers/runtime-apis/handlers/scheduled.mdx b/src/content/docs/workers/runtime-apis/handlers/scheduled.mdx index b952c97fbf7..526c381b640 100644 --- a/src/content/docs/workers/runtime-apis/handlers/scheduled.mdx +++ b/src/content/docs/workers/runtime-apis/handlers/scheduled.mdx @@ -16,7 +16,7 @@ When a Worker is invoked via a [Cron Trigger](/workers/configuration/cron-trigge Use [Local Explorer](/workers/local-development/local-explorer/#test-cron-triggers) to invoke your `scheduled()` handler with a configured or ad hoc cron expression. You can choose the scheduled time and inspect the structured result. -Configure at least one Cron Trigger for the active environment before using this interface. +Cron Trigger testing requires Wrangler 4.139.0 or later, or Cloudflare Vite plugin 1.60.0 or later. Configure at least one Cron Trigger for the active environment before using this interface. For scripted tests, send an HTTP request to `/cdn-cgi/local/scheduled`. Pass `?format=json` to return the structured scheduled handler result. From db288389686cd335d73eeb01d421462717204b50 Mon Sep 17 00:00:00 2001 From: tmo Date: Thu, 24 Sep 2026 17:08:37 +0100 Subject: [PATCH 5/8] Update docs for merged implementation --- ...026-09-22-local-explorer-cron-triggers.mdx | 4 +-- .../workers/configuration/cron-triggers.mdx | 25 +++++++++++++++++-- .../local-development/local-explorer.mdx | 6 ++++- .../runtime-apis/handlers/scheduled.mdx | 4 ++- 4 files changed, 33 insertions(+), 6 deletions(-) diff --git a/src/content/changelog/workers/2026-09-22-local-explorer-cron-triggers.mdx b/src/content/changelog/workers/2026-09-22-local-explorer-cron-triggers.mdx index 88d964120aa..b8dfb8ea469 100644 --- a/src/content/changelog/workers/2026-09-22-local-explorer-cron-triggers.mdx +++ b/src/content/changelog/workers/2026-09-22-local-explorer-cron-triggers.mdx @@ -11,11 +11,11 @@ Local Explorer can now send one-off Cron Trigger invocations to a Worker's `sche The browser interface supports the following tasks: - Invoke configured cron expressions -- Build ad-hoc expressions +- Build ad hoc expressions - Set reusable scheduled times - Inspect outcomes and `noRetry()` status -Ad-hoc triggers and scheduled time presets stay in your browser. They do not write to your Wrangler configuration or deployment. Full logs and traces remain available in the Local Explorer **Observability** views. +Ad hoc triggers and scheduled time presets stay in your browser. They do not write to your Wrangler configuration or deployment. Full logs and traces remain available in the Local Explorer **Observability** views. The Local Explorer API exposes the same operation for tools and AI agents. The request targets an exact Worker name and accepts a cron expression and optional scheduled time: diff --git a/src/content/docs/workers/configuration/cron-triggers.mdx b/src/content/docs/workers/configuration/cron-triggers.mdx index 19685e1dab8..c0d5683eed5 100644 --- a/src/content/docs/workers/configuration/cron-triggers.mdx +++ b/src/content/docs/workers/configuration/cron-triggers.mdx @@ -196,12 +196,14 @@ Some common time intervals that may be useful for setting up your Cron Trigger: Use [`wrangler dev`](/workers/wrangler/commands/general/#dev) or the [Cloudflare Vite plugin](/workers/vite-plugin/) to test Cron Triggers locally. You can use Local Explorer or send an HTTP request. -Cron Trigger testing in Local Explorer requires Wrangler 4.137.0 or later, or Cloudflare Vite plugin 1.58.0 or later. +Cron Trigger testing in Local Explorer requires Wrangler 4.139.0 or later, or Cloudflare Vite plugin 1.60.0 or later. ### Use Local Explorer [Local Explorer](/workers/local-development/local-explorer/) displays the exact Cron Triggers configured for the active environment. It can also test ad hoc expressions without changing your configuration. +To test a configured expression, define at least one Cron Trigger for the active environment. You can test an ad hoc expression without configuring one. + 1. Start your local development server and open Local Explorer. 2. Select **Cron Triggers** > **Configured Crons**. @@ -214,7 +216,11 @@ To test an expression that is not configured, select **Cron Triggers** > **Ad-Ho ### Use an HTTP request -Your local development server exposes `/cdn-cgi/local/scheduled`. If you use the Cloudflare Vite plugin, send requests to your Vite port. Vite uses port `5173` by default. +Your local development server exposes two endpoints for scheduled invocations. If you use the Cloudflare Vite plugin, send requests to your Vite port. Vite uses port `5173` by default. + +#### Use the scheduled route + +Send a request to `/cdn-cgi/local/scheduled` to invoke a scheduled handler. ```sh curl "http://localhost:8787/cdn-cgi/local/scheduled" @@ -249,6 +255,21 @@ Optionally, you can also pass a `time` query parameter to override `controller.s curl "http://localhost:8787/cdn-cgi/local/scheduled?cron=*+*+*+*+*&time=1745856238000" ``` +#### Use the Local Explorer API + +To target an exact Worker available to Local Explorer, send a `POST` request to `/cdn-cgi/local/explorer/api/local/scheduled?worker=`. The `worker` query parameter must match the exact Worker name. + +The JSON body requires a non-empty `cron` field. The optional `scheduled_time` field sets `controller.scheduledTime` using epoch milliseconds. + +```sh +curl -X POST \ + "http://localhost:8787/cdn-cgi/local/explorer/api/local/scheduled?worker=my-worker" \ + -H "Content-Type: application/json" \ + --data '{"cron":"0 * * * *","scheduled_time":1745856238000}' +``` + +The response uses the Local Explorer API envelope. Its `result` includes the handler `outcome` and `noRetry` value. + ## View past events To view the execution history of Cron Triggers, view **Cron Events**: diff --git a/src/content/docs/workers/local-development/local-explorer.mdx b/src/content/docs/workers/local-development/local-explorer.mdx index 2ee56366d48..2d0009f48b8 100644 --- a/src/content/docs/workers/local-development/local-explorer.mdx +++ b/src/content/docs/workers/local-development/local-explorer.mdx @@ -62,10 +62,12 @@ For [D1](/d1/) databases and [Durable Objects](/durable-objects/) that use the [ ## Test Cron Triggers -Local Explorer can send one-off invocations to the [`scheduled()` handler](/workers/runtime-apis/handlers/scheduled/) for your Worker. Configure at least one [Cron Trigger](/workers/configuration/cron-triggers/) for the active environment before using this interface. +Local Explorer can send one-off invocations to the [`scheduled()` handler](/workers/runtime-apis/handlers/scheduled/) for your Worker. It supports both configured Cron Triggers and ad hoc expressions. Cron Trigger testing requires Wrangler 4.139.0 or later, or Cloudflare Vite plugin 1.60.0 or later. +To test a configured expression, define at least one [Cron Trigger](/workers/configuration/cron-triggers/) for the active environment. Ad hoc expressions do not require configuration. + 1. In Local Explorer, select **Cron Triggers** > **Configured Crons**. 2. Under **Scheduled time**, select _Now_. To test another time, select **Add preset** and enter a UTC date and time or epoch milliseconds. @@ -106,6 +108,8 @@ To retrieve the OpenAPI spec: curl http://localhost:8787/cdn-cgi/local/explorer/api ``` +The API includes `POST /cdn-cgi/local/explorer/api/local/scheduled?worker=` for scheduled invocations. The request targets an exact Worker and accepts a required cron expression and an optional scheduled time. For a request example, refer to [Test Cron Triggers locally](/workers/configuration/cron-triggers/#use-the-local-explorer-api). + ### Use with AI agents When Wrangler or the Cloudflare Vite plugin detects it is running inside an AI agent, it prints a hint with the Local Explorer API endpoint directly to the terminal. The agent can fetch the [OpenAPI specification](https://www.openapis.org/) from that endpoint to discover all available operations, then make API calls to read or modify local data, query traces and logs, and debug your Worker. diff --git a/src/content/docs/workers/runtime-apis/handlers/scheduled.mdx b/src/content/docs/workers/runtime-apis/handlers/scheduled.mdx index 526c381b640..05c19d7c703 100644 --- a/src/content/docs/workers/runtime-apis/handlers/scheduled.mdx +++ b/src/content/docs/workers/runtime-apis/handlers/scheduled.mdx @@ -16,7 +16,7 @@ When a Worker is invoked via a [Cron Trigger](/workers/configuration/cron-trigge Use [Local Explorer](/workers/local-development/local-explorer/#test-cron-triggers) to invoke your `scheduled()` handler with a configured or ad hoc cron expression. You can choose the scheduled time and inspect the structured result. -Cron Trigger testing requires Wrangler 4.139.0 or later, or Cloudflare Vite plugin 1.60.0 or later. Configure at least one Cron Trigger for the active environment before using this interface. +Cron Trigger testing requires Wrangler 4.139.0 or later, or Cloudflare Vite plugin 1.60.0 or later. Configure at least one Cron Trigger to select a configured expression. Ad hoc expressions do not require configuration. For scripted tests, send an HTTP request to `/cdn-cgi/local/scheduled`. Pass `?format=json` to return the structured scheduled handler result. @@ -24,6 +24,8 @@ For scripted tests, send an HTTP request to `/cdn-cgi/local/scheduled`. Pass `?f curl "http://localhost:8787/cdn-cgi/local/scheduled?format=json" ``` +To target an exact Worker, use `POST /cdn-cgi/local/explorer/api/local/scheduled?worker=`. For request fields and an example, refer to [Test Cron Triggers locally](/workers/configuration/cron-triggers/#use-the-local-explorer-api). + ::: --- From fb97646b23e0f0429a72be60c07ef2112844f201 Mon Sep 17 00:00:00 2001 From: tmo Date: Thu, 24 Sep 2026 17:35:34 +0100 Subject: [PATCH 6/8] Updated changelog date and expression builder --- ...26-09-24-local-explorer-cron-triggers.mdx} | 2 +- .../workers/configuration/cron-triggers.mdx | 4 +++- .../local-development/local-explorer.mdx | 23 +++++++++++++++++-- 3 files changed, 25 insertions(+), 4 deletions(-) rename src/content/changelog/workers/{2026-09-22-local-explorer-cron-triggers.mdx => 2026-09-24-local-explorer-cron-triggers.mdx} (90%) diff --git a/src/content/changelog/workers/2026-09-22-local-explorer-cron-triggers.mdx b/src/content/changelog/workers/2026-09-24-local-explorer-cron-triggers.mdx similarity index 90% rename from src/content/changelog/workers/2026-09-22-local-explorer-cron-triggers.mdx rename to src/content/changelog/workers/2026-09-24-local-explorer-cron-triggers.mdx index b8dfb8ea469..372e0e107b3 100644 --- a/src/content/changelog/workers/2026-09-22-local-explorer-cron-triggers.mdx +++ b/src/content/changelog/workers/2026-09-24-local-explorer-cron-triggers.mdx @@ -15,7 +15,7 @@ The browser interface supports the following tasks: - Set reusable scheduled times - Inspect outcomes and `noRetry()` status -Ad hoc triggers and scheduled time presets stay in your browser. They do not write to your Wrangler configuration or deployment. Full logs and traces remain available in the Local Explorer **Observability** views. +Ad hoc triggers and scheduled time presets stay in your browser. They do not write to your Wrangler configuration or deployment. Full logs and traces are available in the development session that owns the Worker when that session has **Observability** turned on. The Local Explorer API exposes the same operation for tools and AI agents. The request targets an exact Worker name and accepts a cron expression and optional scheduled time: diff --git a/src/content/docs/workers/configuration/cron-triggers.mdx b/src/content/docs/workers/configuration/cron-triggers.mdx index c0d5683eed5..ed297c487e3 100644 --- a/src/content/docs/workers/configuration/cron-triggers.mdx +++ b/src/content/docs/workers/configuration/cron-triggers.mdx @@ -209,9 +209,11 @@ To test a configured expression, define at least one Cron Trigger for the active 2. Select **Cron Triggers** > **Configured Crons**. 3. Select _Now_ or add a scheduled time preset. 4. Select **Trigger** next to the expression you want to test. -5. Review the handler outcome. Use **Observability** > **Traces** to inspect logs and traces. +5. Review the handler outcome, `noRetry()` status, dispatched expression, and scheduled time. +Full invocation logs are available in the development session that owns the Worker. That session must have **Observability** turned on. + To test an expression that is not configured, select **Cron Triggers** > **Ad-Hoc Triggers**. Ad hoc triggers stay in your browser and do not modify deployed Cron Triggers. ### Use an HTTP request diff --git a/src/content/docs/workers/local-development/local-explorer.mdx b/src/content/docs/workers/local-development/local-explorer.mdx index 2d0009f48b8..e1887130f48 100644 --- a/src/content/docs/workers/local-development/local-explorer.mdx +++ b/src/content/docs/workers/local-development/local-explorer.mdx @@ -30,7 +30,7 @@ Local Explorer works with both [Wrangler](/workers/wrangler/) and the [Cloudflar 2. Open Local Explorer in your browser: - **Wrangler**: press `e` in your terminal. - - **Vite plugin**: Navigate directly to `/cdn-cgi/local/explorer` on your dev server's route and port. + - **Vite plugin**: Go directly to `/cdn-cgi/local/explorer` on your dev server's route and port. Local Explorer is available by default and detects the bindings defined in your [Wrangler configuration](/workers/wrangler/configuration/) automatically. @@ -72,10 +72,29 @@ To test a configured expression, define at least one [Cron Trigger](/workers/con 1. In Local Explorer, select **Cron Triggers** > **Configured Crons**. 2. Under **Scheduled time**, select _Now_. To test another time, select **Add preset** and enter a UTC date and time or epoch milliseconds. 3. Select **Trigger** next to a configured cron expression. -4. Review the outcome and `noRetry()` status. To inspect logs and traces, select **Observability** > **Traces**. +4. Review the outcome, `noRetry()` status, dispatched expression, and scheduled time. 5. (Optional) To test another expression, select **Cron Triggers** > **Ad-Hoc Triggers**. Select **Add trigger**, enter or build an expression, and then select **Trigger**. +Full invocation logs are available in the development session that owns the Worker. That session must have **Observability** turned on. + +### Build an ad hoc expression + +Under **Ad-Hoc Triggers**, select **Expression** to enter an exact expression. Select **Build expression** to create a common five-field UTC expression. The exact expression shown in the row is always dispatched. + +The builder supports minute, hour, day-of-month, and month intervals. It also supports daily, selected-weekday, and monthly schedules. Use these Quartz-like options for more specific schedules: + +| Option | Behavior | +| ------ | ----------------------------------------- | +| `L` | Select the last day or last named weekday | +| `W` | Select the nearest weekday | +| `LW` | Select the last weekday of the month | +| `#` | Select an occurrence of a named weekday | + +Step values start at the field minimum and reset at its boundary. Day steps start on day `1`, and month steps start in January. Dates `29` through `31` do not run in months without that date. + +Switching to **Build expression** does not replace the current expression. Changing a valid builder field regenerates the expression. To use syntax that the builder does not provide, select **Expression** and enter it directly. + Ad hoc triggers and scheduled time presets are stored in your browser. Local Explorer scopes them to the local project and Worker. They do not change your Wrangler configuration or deployed Cron Triggers. Each invocation is a one-off local test. Local development does not run Cron Triggers automatically. From 0f935c85469e618f98957617ee5ae64bccd6333d Mon Sep 17 00:00:00 2001 From: vance Date: Fri, 16 Oct 2026 15:05:29 -0500 Subject: [PATCH 7/8] Empty commit to trigger worker preview From 10742bebdbc97cf095762df588221f6a1971503c Mon Sep 17 00:00:00 2001 From: Brendan Irvine-Broque Date: Sat, 17 Oct 2026 08:05:17 -0700 Subject: [PATCH 8/8] [Workers, cf] Cover Cron Trigger testing with the Cloudflare CLI --- ...26-10-17-local-explorer-cron-triggers.mdx} | 11 ++++- src/content/docs/cf/projects/index.mdx | 2 +- .../workers/configuration/cron-triggers.mdx | 38 ++++++++++++--- .../local-development/local-explorer.mdx | 46 +++++++++++++------ .../runtime-apis/handlers/scheduled.mdx | 4 +- 5 files changed, 76 insertions(+), 25 deletions(-) rename src/content/changelog/workers/{2026-09-24-local-explorer-cron-triggers.mdx => 2026-10-17-local-explorer-cron-triggers.mdx} (62%) diff --git a/src/content/changelog/workers/2026-09-24-local-explorer-cron-triggers.mdx b/src/content/changelog/workers/2026-10-17-local-explorer-cron-triggers.mdx similarity index 62% rename from src/content/changelog/workers/2026-09-24-local-explorer-cron-triggers.mdx rename to src/content/changelog/workers/2026-10-17-local-explorer-cron-triggers.mdx index 372e0e107b3..662f8c83093 100644 --- a/src/content/changelog/workers/2026-09-24-local-explorer-cron-triggers.mdx +++ b/src/content/changelog/workers/2026-10-17-local-explorer-cron-triggers.mdx @@ -3,11 +3,14 @@ title: Test Cron Triggers with Local Explorer description: Local Explorer can invoke configured or ad hoc Cron Triggers with custom scheduled times during local development. products: - workers -date: 2026-09-24 + - cf +date: 2026-10-17 --- Local Explorer can now send one-off Cron Trigger invocations to a Worker's `scheduled()` handler during local development. This removes the need to construct request URLs when testing handler behavior. +Start your local development server with [`cf dev`](/cf/projects/#start-development), [`wrangler dev`](/workers/wrangler/commands/general/#dev), or the [Cloudflare Vite plugin](/workers/vite-plugin/). Open `/cdn-cgi/local/explorer` on the server URL and select **Cron Triggers**. + The browser interface supports the following tasks: - Invoke configured cron expressions @@ -15,7 +18,11 @@ The browser interface supports the following tasks: - Set reusable scheduled times - Inspect outcomes and `noRetry()` status -Ad hoc triggers and scheduled time presets stay in your browser. They do not write to your Wrangler configuration or deployment. Full logs and traces are available in the development session that owns the Worker when that session has **Observability** turned on. +Ad hoc triggers and scheduled time presets stay in your browser. They do not change `cloudflare.config.ts`, your Wrangler configuration, or deployed Cron Triggers. Local development does not run cron schedules automatically. + +Full logs and traces are available in the development session that owns the Worker when that session has **Observability** turned on. + +The following example uses port `8787`. Replace it with your development server port, such as `5173` for Vite. The Local Explorer API exposes the same operation for tools and AI agents. The request targets an exact Worker name and accepts a cron expression and optional scheduled time: diff --git a/src/content/docs/cf/projects/index.mdx b/src/content/docs/cf/projects/index.mdx index db76f01c3d0..f292ccbc546 100644 --- a/src/content/docs/cf/projects/index.mdx +++ b/src/content/docs/cf/projects/index.mdx @@ -111,7 +111,7 @@ Start the project's development server: cf dev ``` -The dev server prints its local URL. +The dev server prints its local URL. Append `/cdn-cgi/local/explorer` to that URL to open [Local Explorer](/workers/local-development/local-explorer/). Use it to inspect local binding data, view logs and traces, and [test Cron Triggers](/workers/local-development/local-explorer/#test-cron-triggers) with a chosen cron expression and scheduled time. ## Build diff --git a/src/content/docs/workers/configuration/cron-triggers.mdx b/src/content/docs/workers/configuration/cron-triggers.mdx index ed297c487e3..159658d8289 100644 --- a/src/content/docs/workers/configuration/cron-triggers.mdx +++ b/src/content/docs/workers/configuration/cron-triggers.mdx @@ -14,6 +14,7 @@ import { Tabs, DashButton, Steps, + AnnotatedConfigExplorer, } from "~/components"; ## Background @@ -89,6 +90,27 @@ Changes such as adding a new Cron Trigger, updating an old Cron Trigger, or dele After you have updated your Worker code to include a `"scheduled"` event, you must update your Worker project configuration. +#### Via cloudflare.config.ts + +For projects managed with the [Cloudflare CLI](/cf/), add `triggers.scheduled()` entries to `worker.triggers` in [`cloudflare.config.ts`](/cf/projects/cloudflare-config/#declare-triggers): + +", + triggers: [triggers.scheduled({ schedule: "0 * * * *" })], + }, +});`} +/> + +Run `cf dev` to test the handler locally. Run `cf deploy` to deploy the configured schedule. + #### Via the [Wrangler configuration file](/workers/wrangler/configuration/) If a Worker is managed with Wrangler, Cron Triggers should be exclusively managed through the [Wrangler configuration file](/workers/wrangler/configuration/). @@ -194,9 +216,9 @@ Some common time intervals that may be useful for setting up your Cron Trigger: ## Test Cron Triggers locally -Use [`wrangler dev`](/workers/wrangler/commands/general/#dev) or the [Cloudflare Vite plugin](/workers/vite-plugin/) to test Cron Triggers locally. You can use Local Explorer or send an HTTP request. +Use [`cf dev`](/cf/projects/#start-development), [`wrangler dev`](/workers/wrangler/commands/general/#dev), or the [Cloudflare Vite plugin](/workers/vite-plugin/) to test Cron Triggers locally. You can use Local Explorer or send an HTTP request. -Cron Trigger testing in Local Explorer requires Wrangler 4.139.0 or later, or Cloudflare Vite plugin 1.60.0 or later. +Cron Trigger testing in Local Explorer requires Wrangler 4.139.0 or later, or Cloudflare Vite plugin 1.60.0 or later. These requirements also apply to the development server started by `cf dev`. ### Use Local Explorer @@ -205,7 +227,7 @@ Cron Trigger testing in Local Explorer requires Wrangler 4.139.0 or later, or Cl To test a configured expression, define at least one Cron Trigger for the active environment. You can test an ad hoc expression without configuring one. -1. Start your local development server and open Local Explorer. +1. [Open Local Explorer](/workers/local-development/local-explorer/#open-local-explorer) and select the Worker you want to test. 2. Select **Cron Triggers** > **Configured Crons**. 3. Select _Now_ or add a scheduled time preset. 4. Select **Trigger** next to the expression you want to test. @@ -214,11 +236,13 @@ To test a configured expression, define at least one Cron Trigger for the active Full invocation logs are available in the development session that owns the Worker. That session must have **Observability** turned on. +Each invocation is a one-off local test. Local development does not run Cron Triggers automatically. + To test an expression that is not configured, select **Cron Triggers** > **Ad-Hoc Triggers**. Ad hoc triggers stay in your browser and do not modify deployed Cron Triggers. ### Use an HTTP request -Your local development server exposes two endpoints for scheduled invocations. If you use the Cloudflare Vite plugin, send requests to your Vite port. Vite uses port `5173` by default. +Your local development server exposes two endpoints for scheduled invocations. The following examples use port `8787`. Use the port printed by your development server, including when you start it with `cf dev`. Vite uses port `5173` by default. #### Use the scheduled route @@ -259,9 +283,9 @@ curl "http://localhost:8787/cdn-cgi/local/scheduled?cron=*+*+*+*+*&time=17458562 #### Use the Local Explorer API -To target an exact Worker available to Local Explorer, send a `POST` request to `/cdn-cgi/local/explorer/api/local/scheduled?worker=`. The `worker` query parameter must match the exact Worker name. +To target an exact Worker available to Local Explorer, send a `POST` request to `/cdn-cgi/local/explorer/api/local/scheduled?worker=`. The `worker` query parameter must match the exact Worker name. To find available Worker names, send a `GET` request to `/cdn-cgi/local/explorer/api/local/workers`. -The JSON body requires a non-empty `cron` field. The optional `scheduled_time` field sets `controller.scheduledTime` using epoch milliseconds. +The JSON body requires a non-empty `cron` field. The optional `scheduled_time` field sets `controller.scheduledTime` using epoch milliseconds. If omitted, it defaults to the current time. ```sh curl -X POST \ @@ -270,7 +294,7 @@ curl -X POST \ --data '{"cron":"0 * * * *","scheduled_time":1745856238000}' ``` -The response uses the Local Explorer API envelope. Its `result` includes the handler `outcome` and `noRetry` value. +The response uses the Local Explorer API envelope. Its `result` includes the handler `outcome` and `noRetry` value. A successful API request does not necessarily mean the handler succeeded. Check `result.outcome` for the invocation result. ## View past events diff --git a/src/content/docs/workers/local-development/local-explorer.mdx b/src/content/docs/workers/local-development/local-explorer.mdx index e1887130f48..f8f6adf29da 100644 --- a/src/content/docs/workers/local-development/local-explorer.mdx +++ b/src/content/docs/workers/local-development/local-explorer.mdx @@ -9,31 +9,49 @@ products: - workers --- -import { PackageManagers, Steps } from "~/components"; +import { PackageManagers, Steps, Tabs, TabItem } from "~/components"; Local Explorer is a browser-based interface for viewing and editing the data in your local [bindings](/workers/runtime-apis/bindings/) and debugging Worker invocations during development. It is available at `/cdn-cgi/local/explorer` on your local development server. Instead of running CLI commands or writing throwaway code to inspect local state, you can open Local Explorer in your browser to work with your data, view traces, and search logs. This is useful when you want to seed test data, verify what your Worker wrote, debug a failing request, or run SQL queries against a local [D1](/d1/) database. -Local Explorer works with both [Wrangler](/workers/wrangler/) and the [Cloudflare Vite plugin](/workers/vite-plugin/). +Local Explorer works with the [Cloudflare CLI](/cf/) (`cf dev`), [Wrangler](/workers/wrangler/), and the [Cloudflare Vite plugin](/workers/vite-plugin/). `cf dev` starts the development server provided by your framework or installed Cloudflare build tool. ## Prerequisites -- Wrangler 4.118.0 or later, or [Cloudflare Vite plugin](/workers/vite-plugin/) 1.50.0 or later +Use Wrangler 4.118.0 or later, or [Cloudflare Vite plugin](/workers/vite-plugin/) 1.50.0 or later. For `cf dev`, these requirements apply to the development server it starts. For details, refer to [How `cf` runs your project](/cf/projects/#how-cf-runs-your-project). ## Open Local Explorer 1. Start a local development session: + + + + In a project configured with [`cloudflare.config.ts`](/cf/projects/cloudflare-config/), run: + + ```sh + cf dev + ``` + + + + -2. Open Local Explorer in your browser: - - **Wrangler**: press `e` in your terminal. - - **Vite plugin**: Go directly to `/cdn-cgi/local/explorer` on your dev server's route and port. + + + + + + + + +2. Append `/cdn-cgi/local/explorer` to the URL printed by your development server and open it in your browser. For example, use `http://localhost:5173/cdn-cgi/local/explorer` for the default Vite port, or `http://localhost:8787/cdn-cgi/local/explorer` for the default Wrangler port. -Local Explorer is available by default and detects the bindings defined in your [Wrangler configuration](/workers/wrangler/configuration/) automatically. +Local Explorer is available by default and detects the bindings defined in [`cloudflare.config.ts`](/cf/projects/cloudflare-config/) or your [Wrangler configuration](/workers/wrangler/configuration/) automatically. ## Supported bindings @@ -64,12 +82,12 @@ For [D1](/d1/) databases and [Durable Objects](/durable-objects/) that use the [ Local Explorer can send one-off invocations to the [`scheduled()` handler](/workers/runtime-apis/handlers/scheduled/) for your Worker. It supports both configured Cron Triggers and ad hoc expressions. -Cron Trigger testing requires Wrangler 4.139.0 or later, or Cloudflare Vite plugin 1.60.0 or later. +Cron Trigger testing requires Wrangler 4.139.0 or later, or Cloudflare Vite plugin 1.60.0 or later. These requirements also apply to the development server started by `cf dev`. -To test a configured expression, define at least one [Cron Trigger](/workers/configuration/cron-triggers/) for the active environment. Ad hoc expressions do not require configuration. +Your Worker must export a `scheduled()` handler. To test a configured expression, define at least one [Cron Trigger](/workers/configuration/cron-triggers/) for the active environment. Ad hoc expressions do not require configuration. -1. In Local Explorer, select **Cron Triggers** > **Configured Crons**. +1. In Local Explorer, select the Worker you want to test, then select **Cron Triggers** > **Configured Crons**. 2. Under **Scheduled time**, select _Now_. To test another time, select **Add preset** and enter a UTC date and time or epoch milliseconds. 3. Select **Trigger** next to a configured cron expression. 4. Review the outcome, `noRetry()` status, dispatched expression, and scheduled time. @@ -95,13 +113,13 @@ Step values start at the field minimum and reset at its boundary. Day steps star Switching to **Build expression** does not replace the current expression. Changing a valid builder field regenerates the expression. To use syntax that the builder does not provide, select **Expression** and enter it directly. -Ad hoc triggers and scheduled time presets are stored in your browser. Local Explorer scopes them to the local project and Worker. They do not change your Wrangler configuration or deployed Cron Triggers. +Ad hoc triggers and scheduled time presets are stored in your browser. Local Explorer scopes them to the local project and Worker. They do not change `cloudflare.config.ts`, your Wrangler configuration, or deployed Cron Triggers. Each invocation is a one-off local test. Local development does not run Cron Triggers automatically. ## Observability -Local Explorer automatically captures traces and logs from every Worker invocation during `wrangler dev` without modifying your code. You get the same instrumentation as production [Workers Logs](/workers/observability/logs/workers-logs/) and [Traces](/workers/observability/traces/), including invocation logs, binding operations, timing, and console output, directly in your browser during development. +Local Explorer automatically captures traces and logs from every Worker invocation during local development with `cf dev`, `wrangler dev`, or the Cloudflare Vite plugin without modifying your code. You get the same instrumentation as production [Workers Logs](/workers/observability/logs/workers-logs/) and [Traces](/workers/observability/traces/), including invocation logs, binding operations, timing, and console output, directly in your browser during development. ### Logs @@ -121,6 +139,8 @@ For example, if a request makes two D1 calls and the second one fails, the trace Local Explorer exposes an API at `/cdn-cgi/local/explorer/api` that provides programmatic access to the same operations available in the browser interface. The API serves an [OpenAPI specification](https://www.openapis.org/) that describes all available endpoints, parameters, and response formats. +The following examples use port `8787`. Replace it with your development server port, such as `5173` for Vite. + To retrieve the OpenAPI spec: ```sh @@ -131,7 +151,7 @@ The API includes `POST /cdn-cgi/local/explorer/api/local/scheduled?worker=