Back to Workflows FAQs
HELP CENTER · FAQWorkflows2 min read

How should a workflow handle events that arrive out of order?

Events can be delayed, retried, or delivered through paths with different timing. If the workflow assumes arrival order equals business order, a late event may overwrite newer state. Define which timestamp or sequence determines precedence and what to do when that information is missing.

Workflows

Choose an ordering rule

Use a source-issued sequence number when available, or a documented event time with a clear tie-breaker. Do not rely on arrival time alone unless the source guarantees ordered delivery for the exact stream and key involved.

Track the latest accepted sequence or version per entity and reject or quarantine older updates. If events represent independent facts rather than replacements, store them as separate records and derive the current view instead of discarding late arrivals.

Handle gaps and corrections

A missing sequence can indicate a delayed event or a delivery gap. Decide whether to wait briefly, request a replay from the source, or mark the entity for reconciliation; avoid silently inventing a state.

Record rejected, delayed, and replayed events with identifiers and reasons. Test permutations of the same event set so the workflow converges to the intended result regardless of delivery order.

Back to Workflows FAQs