Ordering Guarantee of messages / Sequencing

Exactly: This is the model that I want to migrate: don’t use long running workflow, and open 1 workflow per event, but to do that, I need to ensure that this workflows will be executed in order, to garante the consistency of data. If Temporal still not support the ordering, maybe I need to migrate to Google PubSub of something like this.

Temporal cannot guarantee order of execution at such rate.

1 Like

@maxim whats the solution if the average rate is low? i have a use case of doing balance updates for an account. A single workflow will be invoked for all accounts with id as account id. how can i achieve ordering on account level if average rate is 1 per sec?

At a low rate per key, create a workflow per key (using the key as part of the workflow id). Send all events for the given key to the corresponding workflow. Let workflow handle the ordering. Usually, such workflows are signaled using SignalWithStart to create them lazily.