ExamplesWebhook Processing

Webhook processing

Providers deliver the same event twice and sometimes deliver a later event first. A handler that updates a row in place cannot show which delivery committed.

Without Causet

POST /webhooks/provider
  → verify signature
  → update the row
  → call the next service
  → time out and let the provider retry

The second delivery has to guess whether the first one finished.

How Causet fits

Your endpoint still verifies the provider signature and still returns the HTTP acknowledgement. Causet enters when you submit an intent. Use a stable intent id, usually the provider event id, so a retry is the same intent rather than a second business action.

A rejected intent

The counter rule reject_non_positive is the rejection captured on sandbox. A bad payload does not commit:

Error: ERROR: POST https://sandbox.api.causet.cloud/v1/platforms/jamlet/applications/test-new-version/intents/execute returned 422: Delta must be greater than zero

The commands and the following ACCEPTED response are in Inspect execution.

What you gain

The provider retry can target one intent id. A preflight reject is visible as a 422 instead of a half-updated row. Out-of-order facts are separate intents on one entity, so the timeline is the order Causet committed, which is not always the order the provider sent.

Limits

⚠️

Submitting the intent again can run side effects again. Replaying recorded history does not redeliver a webhook and does not call the provider.

  • Your app still owns signature checks, the HTTP 200, and the provider client.
  • Managed outbound delivery is a separate path from the rule that commits state. See Delivery guarantees.
  • A projection of “webhook processed” can lag the commit. A 200 from your endpoint is not projection visibility.