Cloudflare Workflows deleteBatch: clean up after a Sume job
Cloudflare Workflows can delete up to 100 instances per deleteBatch call. Delete only after the Sume job reaches a terminal event, and keep the job id first.

Delete a Workflow instance only after its Sume job has sent a terminal event (job.completed, job.failed or job.canceled) and you have stored the job_id and result. Cloudflare's deleteBatch() removes up to 100 instances per call, along with their stored state, so anything you did not copy out is gone.
What did Cloudflare add?
The changelog entry dated Sep 17, 2026 says delete() removes a single instance and its stored state, and deleteBatch() handles up to 100 instances per call. Read 2026-10-01.
| Call | Scope |
|---|---|
delete() | One instance and its stored state |
deleteBatch() | Up to 100 instances per call |
When is a Sume job safe to forget?
Sume sends terminal job events only; there are no progress or partial deliveries. The job events list also includes webhook.delivery, so a delivery attempt is visible on the job. A job can be terminal while its webhook delivery failed, so a Workflow should not treat a missing callback as a lost job. Read it with status_url before deleting, as in Jobs and results.
How do I avoid deleting a duplicate or live instance?
Dedupe on job_id: the webhook docs say to use it as the idempotency key, and delivery is retried up to 10 attempts, so the same terminal event can arrive more than once. Verify the signature before acting; verifyWebhook is importable from Workers because it uses WebCrypto. Then record job_id, status and artifact URLs in storage that outlives the instance, and only then add the instance id to a batch of at most 100.
Retention of the instance itself is a separate question, covered in Cloudflare Workflows 7-day retention.
What should the cleanup order be?
Terminal event received, signature verified, result persisted by job_id, instance ids queued, then deleteBatch() in chunks of 100. If a delivery never arrives, poll status_url rather than deleting an instance that may still be waiting.
Sources
Related posts
More in Developers
- Codex MCP input schema budget: how many Sume tools you load
Codex 0.158.0 makes MCP and Code Mode input schema budgets configurable. Sume keeps tool descriptions short and shows fewer tools to a read-only session.
- Apply a LUT to video by API: no .cube file, use lutrgb curves
Sume's video filter cannot load a .cube LUT because lut3d is not allowlisted. Per-channel curves with lutrgb or lutyuv are the supported way to grade.
- Colossyan callback vs polling, and Sume terminal-only webhooks
Colossyan posts finished or failed to your callback, or you poll every 5 s. Sume webhooks are terminal-only, so keep status_url polling as a backup.
- Colossyan intrinsicDurationTrackReference vs Sume scene duration
Colossyan can size a scene to the actor's speech. In Sume avatar videos you set voice.duration per scene, silence beats need it, and the total stays 4-60 s.
Written by Sume