Gemini API webhooks for batch jobs: keep a poll backup, as on Sume
Gemini API release notes say webhooks replace polling for Batch and long-running operations. What changes in a client, and why Sume keeps a polling backup.

The Gemini API changelog says webhook support replaces polling for the Batch API and long-running operations, so a client can wait for a push instead of looping on a status call. The sound way to adopt it is the one Sume documents for its own job webhooks: take the push, store it first, and keep a poll available for the events that never arrive.
This post compares the two ideas at the level of client design. It does not describe Gemini's webhook format, which is on Google's pages.
What the changelog lists
Only the webhook entry is used.
| Item | What the page says |
|---|---|
| Webhooks | Replace polling for the Batch API and long-running operations |
What changes in a client
A polling client owns the loop: it submits, then asks until the answer changes. A webhook client owns a public endpoint: it submits, stores the operation id, and waits to be called. The second client needs a stable HTTPS URL, a way to verify who is calling, and a way to handle the same call twice.
Sume's job webhooks make the same trade. A submit with mode: "webhook" and a public HTTPS webhook_url returns 202 with the job envelope and polling URLs, and the callback is stored. Localhost, private-network and non-HTTPS URLs are rejected.
What Sume does about delivery
The delivery rules are explicit, which makes them a useful template for any webhook client.
| Property | Value |
|---|---|
| Events | job.completed, job.failed, job.canceled; terminal only |
| Signature | HMAC SHA 256 over <timestamp>.<raw_body>, header sume-v1=<hex> |
| Retries | Up to 10 attempts in total |
| Spacing | Fixed delay, 30 seconds by default |
| Timeout | 10 seconds per attempt |
| Receiver key | Use job_id as the idempotency key |
Why keep the poll
Ten refused attempts leave a failed delivery and a job that still reached its real terminal state. Sume's docs call delivery an optimization and never the only recovery path, and they tell you to keep status_url polling for the events that never arrive. A client that deletes its poll loop the day it adopts webhooks has no recovery when the endpoint is down.
The poll can be slow and cheap. Check once on a long interval for jobs that have no stored event after a deadline, and use next_poll_after_seconds from the status response when it is present.
A receiver that survives repeats
The same four steps apply to any provider's webhook.
- Verify the signature on the raw body before parsing it. Reject callbacks whose timestamp falls outside a replay window; Sume's docs call five minutes a reasonable default.
- Store the event keyed by the job or operation id. A repeat is then a no-op.
- Answer
2xxafter storing, not after the slow work. - Let a separate worker, and a slow poll, finish what the webhook missed.
Run webhooks are a different surface
Sume has a second webhook family for Format, Action and Agent Completion runs, with events format.run.terminal, action.run.terminal and agent.run.terminal. The signature scheme is identical, so one verifier covers both, but the payload is a full run receipt, not a job result. Pick the handler by event name.
The same applies when you mix providers: route by source and event first, then verify, then store.
Sources
Related posts
More in Comparisons
- Gemini batch inline 20 MB or 2 GB file vs Sume's 100 inline items
Gemini Batch takes inline requests under 20 MB or a file up to 2 GB. Sume bulk takes 1 to 100 inline items. How to size a holiday video batch for each.
- Gemini batch job EXPIRED after 48 hours vs Sume run expires_at
A Gemini batch job ends EXPIRED after 48 hours pending or running. A Sume Format run is finalized as failed at expires_at. Compare the two clocks.
- Gemini Omni Flash 1,240 vs Seedance 2.0 1,225: what 15 Elo means
Hedra lists Gemini Omni Flash first at 1,240 Elo and Seedance 2.0 4K second at 1,225. A 15-point gap is about a 52% win rate; check limits before choosing.
- Omni Flash 4K on Sume: $3.00 for 8 s vs Veo 3.1 Standard $4.80
An 8-second 4K clip costs $3.00 on Sume's Gemini Omni Flash 1.1 and $4.80 on Veo 3.1 Standard at Google list. What 4K means for each, and when 1080p is enough.
Written by Sume