Guides
Ordering
Deliver events about the same thing one at a time and in the order they arrived, while unrelated events keep moving.
By default Ensue delivers events as fast as your destination allows, with retries interleaving. That is right for most webhooks. Some are not: an order.updated that arrives before the order.created before it, or two updates to one record processed at once.
Ordering gives you a line per key. Events that share a key value are handed out in the order they arrived; events with different values do not wait for each other.
Configure it
Set ordering on a flow:
{
"ordering": { "key": ["data.object.id"], "max": 1, "name": "order" }
}
| Field | Meaning |
|---|---|
key |
One to four paths in the request. Events agree on every value to share a line. |
max |
How many events of one key may be out at once. 1 (default) is strict order; up to 20 allows concurrency within a key. |
name |
Optional. Two flows that use the same name share lines, so a Stripe event and a Shopify event for the same order wait for each other. Without a name, a key belongs to its flow. |
What this means in practice
- A failing event holds its line. While event A is retrying, later events with the same key wait behind it. Other keys keep flowing.
- A dead letter releases the line. When an event gives up (it becomes a dead letter), the next event moves on, and the timeline records why.
- A missing key value is delivered unordered, and the timeline says so. Putting all of them in one shared line would make unrelated events wait on each other.
- Unrelated things that happen to share a key value only wait for each other, so choose a key that identifies one thing.
Guarantees
Ensue guarantees order per key, for one flow. It does not offer global ordering across a source, or across different keys, and delivery stays at least once. A redelivered event may be seen again, in its place in line.