Retries & idempotency
Reliable delivery means messages are retried until they land — which means the same message can arrive more than once. Idempotency is how both sides stay correct anyway.
Outbound retries (2mee → you)
Section titled “Outbound retries (2mee → you)”When 2mee delivers an event to your endpoint:
- Success is any 2xx. 2mee stops retrying.
- Retryable failures —
5xx, timeouts, connection errors — are retried with exponential backoff and jitter over a window of 1–3 days. 429is respected: 2mee waits at least yourRetry-Afterbefore the next attempt.- After the window is exhausted, the delivery is dead-lettered and an alert is raised. The endpoint may be auto-paused after sustained failure. You (and we) can replay from the delivery log once the cause is fixed.
Every attempt is recorded in the delivery log — endpoint, event id, status code, latency and error.
Make your handler idempotent
Section titled “Make your handler idempotent”Because a delivery can repeat, key your processing on the envelope id:
- On receipt, check whether you’ve already processed this
id. - If yes, return 2xx and do nothing else.
- If no, record the
id, do the work, return 2xx.
Store seen ids for at least the retry window (a few days).
Inbound idempotency (you → 2mee)
Section titled “Inbound idempotency (you → 2mee)”When you call the ingest API, send a stable messageId that doesn’t change
across your retries:
- 2mee dedupes on it. A duplicate is acknowledged (
409) without re-running the flow. - An entry tag (
webhook-{messageId}) is recorded on the visitor, so re-delivering the same message can’t restart someone’s flow. - Events older than the 5-minute timestamp window are rejected as replays.
Exactly-once flow actions
Section titled “Exactly-once flow actions”Inside a flow, each action is guarded by a “has not done before” completion tag. Re-evaluating the graph, or a duplicate queued delivery, can’t make the same step fire twice for the same person. You don’t manage these tags — they’re how the engine stays exactly-once. See tags & attributes.
Summary
Section titled “Summary”| Concern | Inbound (you → 2mee) | Outbound (2mee → you) |
|---|---|---|
| Idempotency key | messageId (you send) | id (you read) |
| Dedupe owner | 2mee | You |
| Replay window | 5 min (timestamp) | 1–3 days (retry) |
| On exhaustion | Rejected | Dead-lettered + alert + replay |