workerfuse

How to stop a Cloudflare Worker fast without deleting it

Deleting a Worker with Durable Objects can delete their data. Deploy a stub to stop new work and keep the storage. Rollback restores the code, not consumed alarms or terminated Workflows.

When a Worker is on fire your first instinct is to delete it. Please don't, at least not if it has Durable Objects. Deleting the class deletes the data.

What I do instead is deploy a stub version. Workers keep version history, so you upload a tiny version that does nothing, deploy it, and roll back when the fire is out.

export default {
  fetch: () => new Response("paused", { status: 503 }),
  scheduled: () => {},
  // An empty queue handler acks the batch and drops the messages. Retry instead.
  queue: (batch) => batch.retryAll({ delaySeconds: 43200 }),
};
// Not a complete DO stub: keep the same Durable Object class exports and
// wrangler config, with no-op handlers, or the deploy fails.

Then, when you've fixed things:

npx wrangler rollback <previous-version-id> --name <script>

If it has Durable Objects, busy objects can keep running the old code for up to five minutes after a deploy (by default). In an emergency, pass --durable-objects-code-update-mode immediate to the deploy. It resets active objects right away, so in-flight work gets cut off.

Gotchas

  • The stub must export the same Durable Object classes or the deploy fails.
  • DO alarms that fire while paused are consumed. They don't come back on rollback.
  • Queue messages get retried while paused, and those retries count against max_retries. Once a message runs out, it goes to the dead letter queue if you have one, otherwise it's deleted. Messages can also expire during a long pause.
  • A stub deploy doesn't stop live Workflow instances. They keep running the old code, so you have to terminate them, and a rollback won't start them again.

This is what workerfuse does when a Worker passes its limit, and the alert email includes the rollback command.

Pause the runaway Worker. Keep the rest running.

workerfuse checks your Cloudflare spend every five minutes and pauses any Worker over its limit.

Start free trial

Keep reading

Cloudflare spending limits vs pausing one Worker

Cloudflare now has spending limits for Workers and Durable Objects. They're account-wide and block the whole product. Here's how that compares to pausing only the runaway Worker.

Cloudflare billing horror stories: four runaway bills from 2026

A $34,895 alarm loop, a $10,811 bill from an abandoned side project, a ~$36,000 queue loop, and $4,586 of D1 writes. What broke, how long it ran, and what Cloudflare did about it.

How a Durable Objects alarm loop runs up your Cloudflare bill

A Durable Object alarm that keeps rescheduling itself racks up requests, storage writes and duration. What that costs at list price, and how to stop it.