How to retrieve/visualize workfow definition & execution status


I am looking towards ways in Temporal about how do I get the overall workflow definition and current execution status for a particular execution. What I mean by workflow definition is that I want to get all the sequence and various states which the current workflow is defined upon. Since workflows are defined as code, if I have to visually depict my workflow as a flow chart or graph or something which I can transform to a visual model for the end user (say, in UI), is that possible? For example, in tools like Camunda or Flowable, its possible to know the workflow as a BPMN model and also it is possible to know where my current working flow state is in by looking at the BPMN diagram. Is there a way I can achieve the same in Temporal (programmatically)?

Any help on this will be appreciated.


You use the workflow query feature to return a state of a workflow. This state can be in the form that is suitable to generate a user friendly UI/diagram.

Thank you @maxim.