{
  "slug": "wrangler-workflows-instances-delete-removes-one-or-more-instances-a0564b2f375e",
  "title": "wrangler workflows instances delete removes one or more instances",
  "tools": [
    "wrangler"
  ],
  "tags": [
    "agent"
  ],
  "introduced_at": "2026-08-20T17:42:57.000Z",
  "announced_at": "2026-08-20T17:42:57.000Z",
  "effective_at": null,
  "date_basis": "source-publication",
  "status": "unknown",
  "how": {
    "incantation": "When deleting Workflow instances, call `delete()` on a `WorkflowInstance` for one instance, `env.MY_WORKFLOW.deleteBatch(instanceIds)` for 1–100 IDs, or use Wrangler’s instances-delete command with positional IDs or a JSON array file; add `--local` for a local `wrangler dev` session.",
    "examples": [
      "const instance = await env.MY_WORKFLOW.get(\"<instance-id>\");\nawait instance.delete();",
      "const result = await env.MY_WORKFLOW.deleteBatch([\"<instance-id-1>\", \"<instance-id-2>\"]);",
      "npx wrangler workflows instances delete <WORKFLOW_NAME> <INSTANCE_ID>... [--local]\nnpx wrangler workflows instances delete <WORKFLOW_NAME> --filename ./instance-ids.json [--local]"
    ],
    "gotchas": [
      "Version: 4.125.0",
      "WorkflowInstance.delete() (required): Deletes the instance and its stored state; self-deletion stops execution at the awaited call.",
      "instanceIds (required): Array of instance IDs; `deleteBatch()` accepts 1–100 IDs. Duplicates count toward the limit. Results include deleted IDs and per-instance errors.",
      "<NAME> (required): Workflow name.",
      "[ID]: One or more instance IDs; `latest` selects the most recently created instance.",
      "--filename: Path to a JSON file containing an array of instance IDs. Can be combined with positional IDs; together they accept up to 100 IDs.",
      "--local: Targets a Workflow running in a local `wrangler dev` session.",
      "Prerequisite: Use Wrangler 4.125.0 or later for instance deletion; the release note documents the feature as available in that version.",
      "Prerequisite: For `--local`, a local `wrangler dev` session is the target; Wrangler docs state the flag requires Wrangler 4.79.0 or later.",
      "Batch runtime deletion accepts up to 100 instances.",
      "CLI deletion accepts a combined limit of 100 IDs.",
      "Self-deletion stops the current execution."
    ]
  },
  "why_it_matters": "Delete Workflow instances from a remote or local environment.",
  "sources": [
    "https://github.com/cloudflare/workers-sdk/releases/tag/wrangler%404.125.0",
    "https://developers.cloudflare.com/changelog/post/2026-09-17-instance-delete/",
    "https://developers.cloudflare.com/workflows/build/workers-api/",
    "https://developers.cloudflare.com/workflows/build/trigger-workflows/",
    "https://developers.cloudflare.com/workflows/reference/wrangler-commands/",
    "https://developers.cloudflare.com/workers/wrangler/commands/workflows/"
  ],
  "rank": 0.97026,
  "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": "augsep-20261008",
    "verdict_id": "augsep-20261008:augsep-20261008-eaa6e43c788a099f-3:gate",
    "evidence_hash": "6bd888ac08b040d86374f347bbc03f7831e8277618b7511c3f6d7421f7b32c36"
  },
  "review": {
    "draft_hash": "00e6d1f417455b2db70121061a2305a2f721e480a2249277c72e099307f0f71d",
    "reviewer": "publication-gate",
    "reviewed_at": "2026-10-07T00:00:00.000Z",
    "decision": "augsep-20261008:gate",
    "reason": "3 of 3 judge runs approved with p_yes >= 0.9 (mean 0.97 >= 0.9; 2 needed) and Jev gave 0.77 (>= 0.6 needed)."
  }
}
