webhook-notifications

Implements enqueue-first webhook ingestion pipelines with retry lanes and durable-cursor reprocessing.

Updated May 13, 2026
One-click install
npx skills add https://github.com/Hinten/next_erp --skill webhook-notifications-hinten
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: webhook-notifications
Source: https://github.com/Hinten/next_erp/tree/main/.claude/skills/webhook-notifications
Command: npx skills add https://github.com/Hinten/next_erp --skill webhook-notifications-hinten

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Inbound provider webhooks (marketplace orders, payment status, WhatsApp messages) must be acknowledged fast, retried safely, and never silently lost — but hand-rolling receivers per channel leads to inconsistent retry logic, lost events, and providers disabling topics after 5xx responses. This Skill documents the shared enqueue-first notification pipeline every channel in this monorepo uses, so new channels inherit identical resilience behavior. ## Core Features & Use Cases - Shared pipeline architecture: Explains defineNotificationPipeline, the disposition matrix (resolve/drop/park/fail/defer), the failures-only Firestore store, and the durable-cursor reprocess sweep. - Two retry lanes: Distinguishes the hot failed lane (1h window, 5 attempts) from the slow deferred lane (24h window, 7 attempts) for preconditions only a human can clear. - Step-by-step channel onboarding: Walks through schema, collection handle, composite index, adapter, receiver, Cloud Tasks scheduler, and Cloud Functions triggers for adding a new channel. - Use Case: When adding a webhook receiver for a new marketplace, follow the guide to wire signature verification, enqueue-first ack-200 handling, idempotent processing, and the reprocess sweep without persisting every event. ## Quick Start Ask the assistant to add a webhook notification receiver for a new channel following the webhook-notifications pipeline, starting with the schema and Firestore composite index.

Frequently Asked Questions about webhook-notifications

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a webhook receiver for a new channel in this monorepo?

Create a Zod schema spreading notificationResilienceFields, a defineAdminCollection handle, a composite (status, processedAt) Firestore index, a channel adapter calling defineNotificationPipeline, an ack-200 receiver route, a Cloud Tasks scheduler, and onTaskDispatched plus onSchedule functions.

Why does the webhook receiver not write every notification to Firestore?

The pipeline is enqueue-first by design: a notification that processes cleanly writes nothing, avoiding a write per event and giving the task queue rate control over provider API calls. Only failures are persisted so the sweep can re-drive them.

What is the difference between the failed and deferred retry lanes?

The failed lane retries hourly up to 5 attempts for work that errored, while the deferred lane retries daily up to 7 times when an external precondition (like an unconnected account) must clear first. Choose by who can clear the blockage, not severity.

Why are Cloud Tasks messages silently dropped after enqueue?

The queue name must be region-qualified as locations/{region}/functions/{name}; without it the Admin SDK targets us-central1 and drops the task without error. The function export name must also exactly equal the queue constant.

How is idempotency handled for duplicate webhook deliveries?

Idempotency is the handler's job, not the receiver's — nothing dedups at enqueue time. Each process function must be safe to run twice, keyed by the provider's resource id, since delivery is at-least-once from both the provider and Cloud Tasks.

Can the Cloud Tasks webhook flow be tested locally with emulators?

Yes, the tasks emulator works alongside the functions emulator, and the region-qualified queue name is correct for both production and emulator since firebase-admin 12.7.0. Do not pass opts.uri, and note scheduleDelaySeconds is ignored by the emulator's FIFO dispatch.