How will Temporal store the workflow status if we read the workflow definition from json/yaml in code

Hi @Maggie, I think there are different ways you can solve this, here is just my personal opinion:

a) If you are using Java SDK, you can take advantage of the DynamicWorkflow and DynamicActivity interfaces. Here is also a sample that uses them. This can be useful if you decide to create a single workflow that handles multiple json definitions, especially as it can register dynamic signal and query handlers that could be defined inside your json/yaml definitions.

b) You can write the dsl (json) parsing as a library

c) I assume each one of your “nodes” would be some work that has to be done inside an activity/child workflow. In that case it would be useful to move some of the activity options info (like timeouts/ task queue) into your json definitions as well so you can define them for each activity independently if needed.

To answer your questions, for (1) yes you could, you can also opt for generating the base workflow from your json definition as well (code generation), or you can have a generic workflow defined that takes in your json def as input parameter to its workflow method, up to you. For (2) that should be fine, workflow execution ends when the workflow method completes, so you can have looping structures in it.

We also have a Go SDK sample that uses DSL, and we are working on adding one for Java SDK as well currently.

Hope this helps.