Use the Substreams webhook sink. It delivers a module's output to an HTTP endpoint you control, so you can react to onchain events without writing a streaming consumer. It is a self-run sink: Hosted Sinks supports only Postgres and ClickHouse.
What does it support?
As of Substreams v1.24:
- Request signing. Optional auth header and HMAC-SHA256 signatures, so your endpoint can verify the sender.
- Batching.
--webhook-batch-max-blockssends several blocks per call. - Reorg notifications.
--webhook-undo-urlsends a notification when blocks are reorged out. See what is a reorg. - Failure handling.
--webhook-on-failure=exitkeeps a failed block pending across restarts, so nothing is skipped. - Redirects are not followed.
When should I use it?
For low-volume, event-driven reactions: notifications, triggering a workflow, forwarding to a service that already speaks HTTP. For several consumers or replay, use a queue instead — see streaming to Kafka — and for queries, use a database sink.
What should my endpoint do?
Verify the signature, respond quickly, make handling idempotent (include block number and transaction hash in your records), and handle the undo notification by reverting what you derived from reorged blocks.
Frequently asked questions
Is there a managed webhook sink? Not currently; run it yourself.
Get an API key at thegraph.market.
Related: How do I stream blockchain data to Kafka? · What is a blockchain reorg? · How do I stream onchain data to a database?