I am building an operations workflow orchestration tool using the Temporal platform and Python SDK. For this I need to translate a workflow built on the front end application (using React Flow) into a Temporal workflow definition. I have been trying to do this by converting the front end workflow into a JSON in the serverlessworkflow specification and converting the JSON to a Temporal workflow definition.
I haven’t been able to build or find a robust solution that can translate serverless workflow definitions into a Temporal workflow definition. Any suggestions on approach or references to libraries would be super helpful.
While I do not have anything specific to serverless, it is quite normal for people to pass in the entire DSL structure as a workflow parameter and evaluate it in the workflow. Most people represent this as a typed dataclass structure, but it could be JSON/YAML, etc. Then in the workflow if you need to loop and call activities or children or timers or add signal handlers or whatever, you can. The things you call from a workflow do not have to be predefined (e.g. calling an activity by its string name is very normal in these cases).
Just to add, you can use the serverless workflow sdk-python to parse the workflow definition json/yaml into an object model and then follow the workflow states to build out your activity calls etc.
There is a sample for Java SDK using that DSL here if it can help for references.