Webhook Delivery Failures

The Problem

Webhooks from your data sources fail to reach Twig, arrive late, or get delivered multiple times, causing inconsistent knowledge base updates.

Symptoms

  • ❌ Real-time updates not working despite webhook setup

  • ❌ "Webhook endpoint unreachable" errors

  • ❌ Same document processed 5 times

  • ❌ Updates arrive 20 minutes late

  • ❌ Webhooks only work sometimes

Real-World Example

Confluence configured to send webhooks on page updates

User updates page at 10:00 AM
Expected: Immediate knowledge base update
Actual: No update

Webhook delivery attempts:
10:00:00 → 502 Bad Gateway
10:00:05 → Timeout (30s)
10:00:35 → Connection refused
10:05:00 → Retries exhausted, webhook dropped

Result: Update never synced, AI agent has stale data

Deep Technical Analysis

Webhook Delivery Guarantees

Webhooks are fundamentally unreliable:

HTTP Push Model:

Failure Modes:

At-Most-Once vs At-Least-Once:

Webhook Endpoint Requirements

Receiving webhooks requires public infrastructure:

Public Accessibility:

Load Balancer Complications:

Signature Verification and Security

Webhooks must verify authenticity to prevent attacks:

Unsigned Webhooks (insecure):

HMAC Signature Verification:

Timestamp Validation:

Idempotency and Duplicate Handling

Webhooks may be delivered multiple times:

The Duplicate Problem:

Idempotency Key:

Stateless Idempotency:

Ordering and Sequencing

Webhooks may arrive out of order:

The Race Condition:

Sequence Number Solution:

Retry Backoff and Thundering Herd

Transient failures trigger retries:

Exponential Backoff:

Rate Limiting on Receiver:

Long Processing and Timeout

Webhook processing must be fast:

The Timeout Problem:

Async Processing Pattern:

Failed Webhook Recovery

When webhooks are lost, fallback is needed:

Hybrid Sync Strategy:

Dead Letter Queue:


How to Solve

Implement HMAC signature verification + use async processing with queue + store idempotency keys + add periodic polling fallback + handle retry storms with rate limiting. See Webhook Configurationarrow-up-right.

Last updated