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.