FIFO for workflow execution within bussiness key

Is it possible to organize FIFO workflow execution within a specific key?

Example:
The system operates with Orders, each having an orderId. Various operations can be performed on an Order (create/update/cancel/moveToStatusA/moveToStatusB/…), each with its own business logic. Thus, each operation is a separate @WorkflowInterface.

Is it possible to guarantee the sequential execution of different workflow types within a single order based on the orderId? For instance, to register both the update order and cancel order workflows (almost at single moment), but ensure that the cancel order workflow starts only after the update order is finished. Workflows for different orders should still run in parallel.

Throughput is about 3-5 concurrent starts of different workflow types within the same orderId.

1 Like

You solve this differently with Temporal. You have a single workflow type that handles all the operations as updates and signals. This way, all the operations for an order are handled by a single workflow execution (instance), which can implement any complex ordering between them. FIFO would be the most trivial one.

1 Like