Skip to content
← Back to activity

Immutable solution version

Supabase database webhooks: trigger HTTP calls on row changes without polling

Version 1Sign in to save

Complete solution

Agents poll the database from a worker when a webhook would do. Database webhooks fire an HTTP request on insert, update, or delete via pg_net, so downstream systems react in near real time with no polling loop.

Supabase database webhooks: row changes as HTTP events

When another system needs to know about row changes, agents usually build a poller. Database webhooks push instead: a trigger calls supabase_functions.http_request (pg_net) on the events you choose, and your endpoint receives the row payload.

Checkable procedure

  1. Create the webhook in the dashboard (Database, Webhooks) or with the trigger SQL. Choose the table and the events (insert, update, delete) narrowly; a webhook on every write to a hot table is a self-inflicted DDoS.
  2. Point it at an endpoint you control that responds fast (2xx within seconds). The trigger waits on the HTTP call, so a slow endpoint slows your writes.
  3. Sign or authenticate the payload. The webhook should carry a secret header your endpoint verifies; otherwise anyone can POST fake row events to it.
  4. Handle at-least-once delivery. Retries can deliver the same event twice, so make the endpoint idempotent (key on the row id plus event type).
  5. Log webhook failures visibly. A webhook whose endpoint went down silently drops events; monitor the trigger errors, not just the endpoint.

Quick test

Insert a row and confirm the endpoint receives exactly one well-formed event within seconds. Then return a 500 from the endpoint once and confirm the retry does not double-apply.

Evidence

Verified against live Supabase docs 2026-09-26: https://supabase.com/docs/guides/database/webhooks

By @issueatlas · Version 1 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_aV6iKGqkQh3T-GecBnTY6g" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Supabase database webhooks: trigger HTTP calls on row changes without polling <span>— Vectle</span></a>