{
  "slug": "local-explorer-invokes-a-worker-scheduled-handler-during-local-development-753868b037da",
  "title": "Local Explorer invokes a Worker scheduled() handler during local development",
  "tools": [
    "cf"
  ],
  "tags": [
    "agent"
  ],
  "introduced_at": "2026-10-17T00:00:00.000Z",
  "announced_at": "2026-10-17T00:00:00.000Z",
  "effective_at": null,
  "date_basis": "source-publication",
  "status": "unknown",
  "how": {
    "incantation": "When testing `scheduled()` locally, start a development server and use Local Explorer’s Cron Triggers page or API to invoke a configured or ad hoc cron expression, then inspect the result. Full logs and traces are available in the Worker’s owning development session when Observability is enabled.",
    "examples": [
      "curl -X POST \"http://localhost:8787/cdn-cgi/local/explorer/api/local/scheduled?worker=<worker-name>\" -H \"Content-Type: application/json\" --data '{\"cron\":\"0 * * * *\",\"scheduled_time\":1745856238000}'",
      "npx wrangler dev"
    ],
    "gotchas": [
      "worker (required): Exact Worker name targeted by the API request.",
      "cron (required): Cron expression for the invocation.",
      "scheduled_time: Scheduled time in milliseconds since the Unix epoch.",
      "Prerequisite: Use Wrangler 4.118.0 or later, or Cloudflare Vite plugin 1.50.0 or later, for Local Explorer.",
      "Prerequisite: Start a local development session; Local Explorer is available at `/cdn-cgi/local/explorer` on its server.",
      "Ad hoc triggers and scheduled time presets stay in the browser and do not change cloudflare.config.ts, 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 API request targets an exact Worker name and accepts a cron expression and optional scheduled time.",
      "The example uses port 8787; replace it with the development server port, such as 5173 for Vite."
    ]
  },
  "why_it_matters": "Test a Worker's scheduled() handler during local development by invoking a configured or ad hoc Cron Trigger and inspecting its outcome.",
  "before": "The scheduled handler documentation describes invoking it with an HTTP request to `/cdn-cgi/local/scheduled`; `?format=json` returns a structured result.",
  "sources": [
    "https://developers.cloudflare.com/changelog/post/2026-10-17-local-explorer-cron-triggers/",
    "https://developers.cloudflare.com/workers/local-development/local-explorer/",
    "https://developers.cloudflare.com/workers/runtime-apis/handlers/scheduled/"
  ],
  "rank": 0.97043,
  "judge": {
    "publish": true,
    "judge_model": "codex-cli/gpt-6-luna+typesafe/jev-1.13.0",
    "prompt_version": "extract-v7+enrich-v2+judge-v2x3+jev-publish-v1"
  },
  "review_state": "approved",
  "provenance": {
    "run_id": "daily-20261017-20",
    "verdict_id": "daily-20261017-20:daily-20261017-20-67754a3c5138f288-0:gate",
    "evidence_hash": "912a2523331b4da273395919c1bc8cfef28ce2c55c5a8215b1ffcb7451a35f3c"
  },
  "review": {
    "draft_hash": "2527cd7fdcc5f6ef66b1cb6dd1e4a9b2a6af7bfa908cbe06212c833ea254a134",
    "reviewer": "publication-gate",
    "reviewed_at": "2026-10-17T00:00:00.000Z",
    "decision": "daily-20261017-20:gate",
    "reason": "3 of 3 judge runs approved with p_yes >= 0.9 (mean 0.97 >= 0.9; 2 needed) and Jev gave 0.72 (>= 0.6 needed)."
  }
}
