{
  "slug": "createtestharness-introspects-workflow-bindings-3961465cf9b0",
  "title": "createTestHarness() introspects Workflow bindings",
  "tools": [
    "wrangler"
  ],
  "tags": [
    "agent"
  ],
  "introduced_at": "2026-06-30T16:38:09.000Z",
  "announced_at": "2026-06-30T16:38:09.000Z",
  "effective_at": null,
  "date_basis": "source-publication",
  "status": "unknown",
  "how": {
    "incantation": "When a Worker route starts a Workflow, use `createTestHarness()` to introspect its binding, disable the named sleep, trigger the route, and wait for the instance to complete.",
    "examples": [
      "const harness = createTestHarness({ workers: [{ configPath: \"./wrangler.json\" }] });\nconst worker = harness.getWorker();\nawait using workflow = await worker.introspectWorkflow(\"MY_WORKFLOW\");\nawait workflow.modifyAll(async (modifier) => {\n  await modifier.disableSleeps([{ name: \"wait-for-approval\" }]);\n});\nawait worker.fetch(\"/start-workflow\");\nconst [instance] = await workflow.get();\nawait instance.waitForStatus(\"complete\");"
    ],
    "gotchas": [
      "Version: wrangler@4.106.0",
      "workers[].configPath (required): Path to the Worker Wrangler configuration file.",
      "bindingName (required): Workflow binding name to introspect; instances created after introspection starts are captured.",
      "disableSleeps([{ name }]): Disables the specified Workflow sleep; `name` identifies the sleep step.",
      "waitForStatus(status) (required): Waits until the instance reaches the requested status; use `\"complete\"` here.",
      "Prerequisite: A Worker project with a Wrangler configuration file, a Node.js test runner, and `wrangler` installed as a development dependency.",
      "Introspection is by Workflow binding name.",
      "Tests can introspect a known Workflow instance by ID or track instances created after introspection starts.",
      "Docs conflict: Current documentation was last updated July 27, 2026, after Wrangler 4.106.0. Its example uses an async `modifyAll` callback and awaits `disableSleeps`; the release-note example uses a synchronous callback. The release note is retained for the target version."
    ]
  },
  "why_it_matters": "Test a Worker route that starts a Workflow and wait for the resulting Workflow instance to complete.",
  "sources": [
    "https://github.com/cloudflare/workers-sdk/releases/tag/wrangler%404.106.0",
    "https://developers.cloudflare.com/workers/testing/test-harness/interact-with-workers/",
    "https://developers.cloudflare.com/workers/testing/test-harness/get-started/"
  ],
  "rank": 0.98023,
  "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-2841bfddc8d257e6-5:gate",
    "evidence_hash": "630dc99354ee14d0aca270af3150e2f48682af60af86551fa937bfdb7badd326"
  },
  "review": {
    "draft_hash": "fc96a1044fffaafc87de77366771212b998c789e1d70ca66d90993e84853b01e",
    "reviewer": "publication-gate",
    "reviewed_at": "2026-10-07T00:00:00.000Z",
    "decision": "backfill-20261007:gate",
    "reason": "3 of 3 judge runs approved with p_yes >= 0.9 (mean 0.98 >= 0.9; 2 needed) and Jev gave 0.76 (>= 0.6 needed)."
  }
}
