Skip to content

Add cost-safe webhook automation support - #264

Draft
wenbinf wants to merge 2 commits into
mainfrom
feature/webhooks-content-automation
Draft

Add cost-safe webhook automation support#264
wenbinf wants to merge 2 commits into
mainfrom
feature/webhooks-content-automation

Conversation

@wenbinf

@wenbinf wenbinf commented Aug 14, 2026

Copy link
Copy Markdown
Member

Summary

  • add opt-in, Cloudflare Queue-backed webhook delivery with an atomic D1 outbox, bounded retries, daily and endpoint limits, Standard Webhooks signing, secret rotation, reconciliation, retention, and automatic endpoint pausing
  • define exact, stable snapshots and canonical examples for all 22 webhook events in the generated OpenAPI contract, including signed test markers and correlation/causation metadata
  • add Webhooks administration with Overview, Endpoints, Event explorer, and Deliveries views; Event explorer can preview generated or current content, inspect payload/schema/headers, print locally without side effects, or send a signed test through the normal delivery path
  • keep the first endpoint form visible as an empty-state setup step, then move Add endpoint and Edit into a shared modal once endpoints are configured
  • add Queue usage accounting, explicit deployment opt-in, a Stripe-like local listener, and microfeed webhook sample discovery from each instance's OpenAPI document
  • add a standalone Content automation documentation section, runnable agent-oriented recipes, and a persistent automation skill with signature verification, test-event gating, durable acknowledgement, deduplication, and loop prevention

This gives people and deployed agents a cost-bounded way to discover exact payloads and react to content changes without polling, while keeping webhook infrastructure optional for ordinary microfeed deployments.

Related issue

N/A

Testing

  • yarn check
  • git diff --check
  • yarn lint:openapi
  • focused Admin, CLI, OpenAPI, webhook, and Worker tests
  • CLI packaged smoke tests
  • documentation generation and validation
  • automation skill validation

The complete check passes all unit and Worker tests and verifies the production Worker, CLI package, generated API contract, and documentation builds.

Screenshots

N/A — no screenshots were requested. The Admin routes and components are covered by component and Worker tests.

Risks

  • Deployments must explicitly opt in with yarn manage deploy --enable-webhooks; ordinary deployments do not create or bind a Queue.
  • Event explorer previews and local terminal prints are free and side-effect-free, while endpoint sends use the normal Queue, retry, budget, delivery-history, and failure-streak behavior.
  • The D1 migrations add webhook storage and named API-key scopes. Existing credentials retain read/write compatibility.
  • Snapshot restores intentionally omit deployment-encrypted webhook endpoints and delivery history; administrators recreate endpoints after restoration.
  • Delivery is at-least-once, so receivers must deduplicate delivery IDs and durably acknowledge work before long-running processing.

Checklist

  • This pull request contains one focused change.
  • Tests were added or updated when behavior changed.
  • Documentation was updated when commands or public behavior changed.
  • No secrets, private configuration, production data, or generated files are included.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant