{
  "slug": "wrangler-declares-workflow-exports-in-exports-ac32289c2a00",
  "title": "wrangler declares Workflow exports in `exports`",
  "tools": [
    "wrangler"
  ],
  "tags": [
    "agent"
  ],
  "introduced_at": "2026-09-24T20:10:58.000Z",
  "announced_at": "2026-09-24T20:10:58.000Z",
  "effective_at": null,
  "date_basis": "source-publication",
  "status": "unknown",
  "how": {
    "incantation": "If a Worker defines a `WorkflowEntrypoint` class, declare it in `exports` under the class name with `type: \"workflow\"` and a Workflow `name`; add supported settings as needed. Deploy the Worker with Wrangler to upload and provision the Workflow.",
    "examples": [
      "{\n  \"exports\": {\n    \"MyWorkflow\": {\n      \"type\": \"workflow\",\n      \"name\": \"my-workflow\",\n      \"limits\": { \"steps\": 100 },\n      \"schedules\": \"0 * * * *\"\n    }\n  }\n}",
      "npx wrangler deploy"
    ],
    "gotchas": [
      "Version: 4.139.0",
      "exports.MyWorkflow (required): Map key is the exported class name; it must name a class extending `WorkflowEntrypoint`.",
      "type (required): Set to `\"workflow\"`.",
      "name (required): Workflow name; unique within the account.",
      "limits.steps: Maximum steps a Workflow instance may run.",
      "concurrency.limit: Maximum Workflow instances that can run concurrently; documented by the `@cloudflare/config` helper.",
      "schedules: Cron schedule or schedules that start Workflow instances automatically.",
      "default_retention.success_retention: Retention duration for successful or terminated instances; accepts a duration string or milliseconds.",
      "default_retention.error_retention: Retention duration for errored instances; accepts a duration string or milliseconds.",
      "Prerequisite: Workflow exports require Wrangler 4.139.0 or above.",
      "Prerequisite: For `cloudflare.config.ts`, the documented helper is `exports.workflow({ name, limits, concurrency, schedules, defaultRetention })`; the class name is the map key.",
      "A Workflow may be declared both as a binding and as an export if both declarations use the same class and do not set the same setting to different values.",
      "A binding to another Worker's Workflow cannot share a name with an export.",
      "Local development does not yet act on these entries.",
      "Docs conflict: The Wrangler configuration and changelog pages list `limits`, `schedules`, and `default_retention` for Workflow exports, but do not list `concurrency`; the current `@cloudflare/config` helper docs do include `concurrency.limit`. The release note says exports accept the same settings as bindings, including concurrency. Verify the installed Wrangler/config schema before using concurrency in Wrangler JSON/TOML."
    ]
  },
  "why_it_matters": "Declare and deploy a Workflow defined by a Worker using the exports configuration map.",
  "before": "Previously, a Worker could only define a Workflow through a `workflows` binding, even when it never called the Workflow itself.",
  "sources": [
    "https://github.com/cloudflare/workers-sdk/releases/tag/wrangler%404.139.0",
    "https://developers.cloudflare.com/workflows/build/workers-api/",
    "https://developers.cloudflare.com/workers/wrangler/commands/",
    "https://developers.cloudflare.com/workers/wrangler/configuration/",
    "https://developers.cloudflare.com/cf/projects/cloudflare-config/",
    "https://developers.cloudflare.com/changelog/post/2026-09-24-workflow-exports/"
  ],
  "rank": 0.94029,
  "judge": {
    "publish": true,
    "judge_model": "codex-cli/gpt-6-luna+typesafe/jev-1.13.0",
    "prompt_version": "extract-v7+enrich-v1+judge-v2x3+jev-publish-v1"
  },
  "review_state": "approved",
  "provenance": {
    "run_id": "gap-20261007",
    "verdict_id": "gap-20261007:gap-20261007-9e446e9231bc7591-3:gate",
    "evidence_hash": "924505b5591f93d2a2b1ec457dcc379c82eeff43c183c12d049005dd2981b17d"
  },
  "review": {
    "draft_hash": "4abe927689eb3a30358dfc61f03a03a636d1df769814db71dc5f0223ec10c66f",
    "reviewer": "publication-gate",
    "reviewed_at": "2026-10-07T00:00:00.000Z",
    "decision": "gap-20261007:gate",
    "reason": "3 of 3 judge runs approved with p_yes >= 0.9 (mean 0.94 >= 0.9; 2 needed) and Jev gave 0.77 (>= 0.6 needed)."
  }
}
