Sequential Workflow queue

We are testing out a design where we need have a object that can be activated and deactivated several times.

A activate Workflow could be started several times as well as a termination Workflow. But both cannot run in the same time and they should run in the sequence they where triggered.

So the user could call


Each request is parsed ad validated as part of a initial Workflow and then it should be passed on to a for that object unique Workflow to handle the actual activate and deactivate in the order they came in. (it’s important that activate and deactivate dont run at the same time)

How do you recommend we do this with temporal?

1 Like

We could have a Workflow running for each active object but that could turn out to be 100 of thousands workflows running several year with nearly nothing happening.
Would that be a problem?

Running a large number of workflows for a long time is not a problem.

But in your case I’m not sure if you need to keep the workflow open, unless it has some time based logic. You can close the workflow after some time (1 day for example) and reopen it on the next signal if out of order signals cannot be received after 1 day.