wrangler workflows instances terminate supports rollback
Introduced 2026-07-09 · score 0.96
HOW TO USE IT
When terminating a Workflow instance and you want registered rollback handlers to run first, call `WorkflowInstance.terminate({ rollback: true })` or use Wrangler’s terminate command with `--rollback`.
let instance = await env.MY_WORKFLOW.get("<INSTANCE_ID>");
await instance.terminate({ rollback: true });npx wrangler workflows instances terminate <WORKFLOW_NAME> <INSTANCE_ID> --rollbacknpx wrangler workflows instances terminate <WORKFLOW_NAME> <INSTANCE_ID> --local --rollbackWHY THIS HELPS
Terminate a Workflow instance while running its registered rollback handlers.
REQUIREMENTS AND LIMITATIONS
- Version: 4.109.0
- Availability: CLI rollback support includes local mode.
- rollback: Set to `true` to run registered rollback handlers before the instance reaches `terminated`; steps without rollback handlers are skipped.
- --rollback: Run registered rollback handlers before terminating; default is `false`.
- <WORKFLOW_NAME> (required): Name of the workflow.
- <INSTANCE_ID> (required): ID of the instance; `latest` can be used instead of a UUID.
- --local: Interact with the local dev session.
- The rollback option is only sent for terminate operations.
- The Local Explorer API rejects the option for pause, resume, and restart actions.
FIRST-PARTY EVIDENCE
- https://github.com/cloudflare/workers-sdk/releases/tag/wrangler%404.109.0
- https://developers.cloudflare.com/workflows/build/workers-api/
- https://developers.cloudflare.com/workers/wrangler/commands/workflows/
- https://developers.cloudflare.com/workflows/build/trigger-workflows/
Check the installed version and the source before using it. Entry JSON