Skip to content

feat(webhook): Postgres-backed WebhookDeliverySupervisor for multi-worker durability #352

@bokelley

Description

@bokelley

Summary

Multi-worker deployments need durable circuit-breaker state and sequence numbers across processes. Reference SQLAlchemy ORM implementation of the supervisor seam shipped in PR #348.

Design

Tables

  • webhook_circuit_state — per-endpoint state (open/half-open/closed, failure counts, next attempt timestamp)
  • webhook_delivery_queue — in-flight retry queue, polled with FOR UPDATE SKIP LOCKED
  • webhook_delivery_log — audit history

Pattern

Cross-process sequence-number durability via DB primary key. Pattern proves out the broader "Postgres-as-queue" approach used by graphile-worker and river. The FOR UPDATE SKIP LOCKED polling is the canonical multi-worker leasing primitive.

Adoption story

Salesagent's migration plan flags multi-worker durability as a real blocker at scale — this lands the reference adopters can fork.

Cross-references

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions