For the complete documentation index, see llms.txt. This page is also available as Markdown.

Duplicate Events and Delivery Failures

Event senders can deliver an event more than once, especially after a timeout. Design event-driven workflows to recognize repeated deliveries.

Reconcile a repeated event before writing again

Illustrative application logic. Use a durable, atomic event ledger and provider-supported idempotency where available. Recovery must reconcile interrupted operations; a missing completion marker does not prove the external write failed.

Copy the example
event_id = event.stable_id
state = durable_ledger.lookup(event_id)

if state == "completed":
    return previous_result(event_id)
if state in {"processing", "uncertain"}:
    return reconcile_destination(event_id)

# Use an atomic claim to avoid concurrent duplicate work.
if durable_ledger.claim_if_absent(event_id):
    perform_and_record_business_operation(event)

Before you begin

A stable event ID or business identifier from the sender.

Key concepts

Term
Definition

Event ID

An identifier for a delivered event. Use it to recognize duplicates where the sender guarantees stable event identifiers.

Idempotency

A contract under which repeating the same intended operation does not create an additional change. Use it only where the provider or public operation explicitly supports it.

Retry

A repeated attempt after a failed or uncertain operation. It can repeat external changes; use it only when the result is understood.

Side effect

A change outside the returned answer, such as creating a record or sending email. Cancellation or release rollback does not undo a completed side effect.

Reconciliation

Checking the run or destination to determine whether an uncertain operation completed. Do this before retrying a write after a timeout.

Handle duplicate events

  1. Keep the event identifier with the workflow input.

  2. Check whether the corresponding business operation has already completed before writing again.

  3. Inspect delivery history and run history together when an event is missing or repeated.

Repeated delivery does not unintentionally repeat the business operation.

Behavior and limitations

Do not assume exactly-once delivery. A sender can retry even when the first workflow is still running. A failed delivery response does not establish that no external change occurred. Use provider-supported idempotency controls where available and preserve external record IDs for reconciliation.

Trigger Activation and Execution Context

Was this helpful?