Black Friday bulk queue: reconcile webhooks received against counts
A bulk queue has no webhook, and canceled runs send none. Count terminal events per item, then compare them with the queue's counts to find what is missing.

If you armed a webhook on every item of a Sume bulk queue, the number of deliveries you receive can legitimately be lower than the item count. The queue has no webhook, and a canceled or skipped run sends none, so reconcile against the queue instead of waiting for N events.
Where the two numbers come from
- Webhooks: each child registers its own
communication.webhook_urland gets one signedformat.run.terminalPOST when it completes or fails. - Queue:
GET /v1/format-run-queues/{id}returnscountswithtotal,completed,failedandcanceled. - Gap: canceled runs, and deliveries that are still retrying or exhausted.
A reconcile loop
Keep a set of request_id values from verified deliveries. In the webhook body request_id equals the run id, and the queue item holds the same run_id. Once the queue is completed, subtract.
def missing(queue, seen_request_ids):
out = []
for it in queue["items"]:
if it["status"] == "canceled":
continue # canceled runs send no webhook
if it["run_id"] and it["run_id"] not in seen_request_ids:
out.append(it["run_id"])
return outWhat to do with the leftovers
Read each missing run with GET /v1/format-runs/{run_id} and look at webhook_delivery.status: pending and retrying mean Sume is still trying, exhausted means all ten attempts failed. For those, POST /v1/format-runs/{run_id}/webhook/redeliver replays a real run to your URL. Items with run_id: null failed to start; the queue item error says why.
Sources
Related posts
More in Developers
- Black Friday code freeze checklist for a Sume Format integration
Before the freeze: key scopes, spend caps, idempotency keys, a webhook test, queue failure handling and the rate-limit budget, all drawn from the Sume docs.
- Black Friday webhooks: staging and production URLs for a Sume Format
Webhook URLs must be public HTTPS and are re-checked at delivery. Use a separate URL per environment and send a test delivery before a bulk queue goes out.
- Black Friday spike: your webhook returns 503, what Sume retries
If your endpoint sheds load on Black Friday, Sume retries a terminal webhook up to 10 times with doubling backoff. Know the schedule and what to do after.
- Save a 30-second Seedance 2.5 clip to S3 with boto3, no temp file
Stream the finished MP4 from Sume's /content endpoint straight into S3 with boto3 upload_fileobj. Includes the 30 s price table and a short script.
Written by Sume