retry_failed_webhook
Mark failed Stripe webhook events for manual reprocessing in the audit log. Select targets by event IDs or a time range, with dry run mode for preview.
Instructions
Mark failed Stripe webhook events (the billing_dead_letter table) for reprocessing in the audit log (POST /v1/tier2/webhook-events/retry). Finishes "retry all the Stripe webhooks that failed transiently last week" in one prompt. Select targets by eventIds (specific events, up to 100) or fromTimestamp/toTimestamp (range, 7-day cap). dryRun=true previews the list; dryRun=false records a 'marked_for_manual_redispatch' entry per event in the audit log (the founder performs the actual retry via wrangler / the Stripe dashboard; fully automatic re-dispatch is a later phase). Emits use a deterministic idempotencyId (sha1(endpoint+accountId+eventId)); duplicate runs with the same args are silently skipped. Founder-operations only (an internal billing-webhook recovery tool; general accounts get 403). billing_dead_letter is an internal cross-account table and actual re-dispatch stays manual, so there is no plan to open this up. Returns (dryRun=true) { dryRun: true, targetCount, events: [{eventId, eventType, reason, receivedAt}] }; (dryRun=false) { dryRun: false, targetCount, succeeded: string[], failed: [{eventId, reason}], skipped: string[], narrative, retriedAt }. Audit: emits tier2.retry_failed_webhook per event.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dryRun | No | true = preview only; false = actually emit the markers. Default false | |
| eventIds | No | Array of Stripe event ids to retry (evt_xxx format, up to 100). Can be combined with fromTimestamp | |
| approvalId | No | Approval id granted via request_approval (apr_ + 32 hex; create with action 'retry_failed_webhook'). Server-side verification + atomic consumption on actual execution (1 approval = 1 execution). dryRun only verifies | |
| maxRetries | No | Per-request cap (1-100, default 10) | |
| toTimestamp | No | Range end (ISO-8601, optional) | |
| fromTimestamp | No | Range start (ISO-8601; more than 7 days ago is rejected with 400) |