So if we map to temporal way of coding it then does it mean 1 state machine is 1 workflow or 1 state machine is equal to many workflow?
You can convert a single state machine to a single workflow type or break it into multiple workflow types if it is too complex to be managed by a single team.
At a time we have 100s of similar state machine running.
Each workflow type can have a practically unlimited number of instances (we tested to hundreds of millions) running in parallel.
And these workflows need to be dynamically created and registered which I am not sure if it’s possible or not.
What is the use case for their dynamic creation? Could you just implement them in code?
I forgot to ask. workflow and worker. how do you decide how many workers are enough to run certain number of workflow.
I am still thinking on how to move from our state machine to workflow. As we are currenlty using Spring State Machine. So could that Spring state machine be a workflow or we just code it using plain Kotlin (in our case) and all external call (db, network etc) are activity in temporal?
What is the use case for their dynamic creation? Could you just implement them in code?
Hmm so in our case we have bunch of spring boot configs which decide which spring state machines to load, then all these state machines get triggered on a certain type of kafka events. And I read that the workflows need to be registered on startup and then also worker needs to be restarted if there are changes to the workflows ?
Sorry if this is sounding that I am mixing this up. You could direct me to right documentation as well
I forgot to ask. workflow and worker. how do you decide how many workers are enough to run certain number of workflow.
You watch schedule_to_start latency metric. If it starts growing then the workers are not able to keep up.
I am still thinking on how to move from our state machine to workflow. As we are currenlty using Spring State Machine. So could that Spring state machine be a workflow or we just code it using plain Kotlin (in our case) and all external call (db, network etc) are activity in temporal?
It is possible to implement a workflow to represent a state machine. In some rare cases it makes sense. In the majority of the situations using plain Kotlin for orchestration and activities for external calls would make code much more simple.
And I read that the workflows need to be registered on startup and then also worker needs to be restarted if there are changes to the workflows ?
Yes, workflows are registered at startup. Usually, it is not hard to enumerate all the implemented workflows during the startup phase. We will provide the Spring boot integration to simplify this, but for now it is your responsibility to perform the registration.
Yes, workers need to be restarted if workflow definitions changed. And the workflow definition must use Workflow.getVersion to ensure that the changes are backwards compatible.
It is also possible to implement the dynamic workflow loading, but I would start from a more simple approach first.