If you manage processes that take minutes or hours — for example deep research, generating long videos, or thousands of prompts in a batch — you probably know the annoyance of having to continuously polling to know when a task finishes. Sound familiar? Google announces a change that flips that flow: event-driven Webhooks in the Gemini API.
What changes with Gemini API Webhooks
Instead of repeatedly asking "is it done yet?", the Gemini API can now push an HTTP POST to your server the moment a task finishes. That means less friction, fewer useless calls, and noticeably lower latency for your app to react in real time.
What does this look like in practice? Imagine a pipeline that processes thousands of prompts or renders long videos: you no longer need to keep sockets open or run cron jobs to check statuses. The result arrives at your endpoint and you can move on to the next step immediately.
How it works (practical summary)
- Global per-project setup: you define a webhook secured via HMAC to receive all relevant events.
- Per-request override: you can specify a different webhook for each job, useful for dynamic routing or multi-tenant setups, secured with JWKS.
- Guaranteed delivery: the platform offers delivery at least once with automatic retries for up to 24 hours.
Security and reliability
It's not just an uncontrolled POST. Each request includes signed headers to help you verify origin and prevent replays: webhook-signature, webhook-id and webhook-timestamp.
Requests are signed and delivery is retried for up to 24 hours, which improves both security and resilience against transient failures.
That design follows standard Webhook specifications, so you can apply common best practices: validate signatures, implement idempotency on your receiver, and handle duplicate deliveries.
Concrete use cases
- Deep Research: receive partial or final results when an intensive analysis finishes.
- Long video generation: long-running encodes can automatically notify the orchestrator when they're done.
- Batch API: send thousands of prompts and have each batch notify you on completion, avoiding constant checks.
How to get started today
- Read the official guide to see the full event catalog and security examples.
- Try the Cookbook with an end-to-end integration: bring your endpoint, validate the signature and process the payload.
If you use the Python SDK you can set per-request webhooks in seconds; if you prefer centralized control, the per-project option with HMAC keeps everything orderly and secure.
This update isn't just a technical improvement: it changes how you design long, distributed flows. Less polling means lower costs, less complexity, and faster responses for users and services.
Source
https://blog.google/innovation-and-ai/technology/developers-tools/event-driven-webhooks
