{
  "slug": "wrangler-workflow-steps-support-dynamic-retry-delays-in-local-dev-6a1608ccc313",
  "title": "wrangler Workflow steps support dynamic retry delays in local dev",
  "tools": [
    "wrangler"
  ],
  "tags": [
    "agent"
  ],
  "introduced_at": "2026-07-09T18:25:36.000Z",
  "announced_at": "2026-07-09T18:25:36.000Z",
  "effective_at": null,
  "date_basis": "source-publication",
  "status": "unknown",
  "how": {
    "incantation": "When a Workflow step needs a retry delay that varies by failed attempt, set `retries.delay` to a function that receives `{ ctx, error }` and returns milliseconds or a duration string.",
    "examples": [
      "await step.do(\"call flaky API\", { retries: { limit: 5, backoff: \"constant\", delay: ({ ctx }) => ctx.attempt * 1000 } }, async () => { /* ... */ });"
    ],
    "gotchas": [
      "Version: 4.110.0",
      "Availability: In local dev.",
      "retries.limit (required): Maximum number of retries for the step.",
      "retries.delay (required): Fixed duration or function returning the next delay in milliseconds or as a duration string.",
      "retries.backoff: Retry backoff strategy: `constant`, `linear`, or `exponential`.",
      "ctx (required): Current Workflow step context; `ctx.attempt` is the 1-indexed attempt number.",
      "error (required): Error that caused the retry.",
      "Prerequisite: Cloudflare Workflows is available on Free and Paid plans.",
      "The function is invoked once per failed attempt with a 5 second timeout.",
      "If the function throws, times out, or returns an invalid value, the step fails without further retries.",
      "Docs conflict: The current retry documentation was updated after Wrangler 4.110.0 and also documents Promise-returning delay functions; that support is not stated in the release note."
    ]
  },
  "why_it_matters": "Set per-attempt retry delays for a Workflow step when running it in local development.",
  "before": "Step retries used fixed delay durations with a backoff strategy.",
  "sources": [
    "https://github.com/cloudflare/workers-sdk/releases/tag/wrangler%404.110.0",
    "https://developers.cloudflare.com/workflows/build/sleeping-and-retrying/",
    "https://developers.cloudflare.com/workflows/build/step-context/",
    "https://developers.cloudflare.com/workflows/",
    "https://developers.cloudflare.com/changelog/post/2026-07-09-dynamic-retry-delays/"
  ],
  "rank": 0.92036,
  "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": "backfill-20261007",
    "verdict_id": "backfill-20261007:backfill-20261007-d9c66974b2a9fd78-1:gate",
    "evidence_hash": "974311a728b3c4ab3ebcd01104d0c0dbc4f2d5a7ec331e1dfefc7f5135b6cce7"
  },
  "review": {
    "draft_hash": "1ddea0d1a70c1f27ded67aa2783e4bbd4dcdfb41b998b457cb7e677bb99c5f84",
    "reviewer": "publication-gate",
    "reviewed_at": "2026-10-07T00:00:00.000Z",
    "decision": "backfill-20261007:gate",
    "reason": "2 of 3 judge runs approved with p_yes >= 0.9 (mean 0.92 >= 0.9; 2 needed) and Jev gave 0.70 (>= 0.6 needed)."
  }
}
