class documentation

A workflow's ID and immutable history.

Static Method from_json Construct a WorkflowHistory from an ID and a json dump of history.
Method to_json Convert this history to JSON.
Method to_json_dict Convert this history to JSON-compatible dict.
Class Variable events History events for the workflow.
Class Variable workflow_id ID of the workflow.
Property run_id Run ID extracted from the first event.
@staticmethod
def from_json(workflow_id: str, history: Union[str, Dict[str, Any]]) -> WorkflowHistory: (source)

Construct a WorkflowHistory from an ID and a json dump of history.

This is built to work both with Temporal UI/tctl JSON as well as to_json even though they are slightly different.

Parameters
workflow_id:strThe workflow's ID
history:Union[str, Dict[str, Any]]A string or parsed-to-dict representation of workflow history
Returns
WorkflowHistoryWorkflow history
def to_json(self) -> str: (source)

Convert this history to JSON.

Note, this does not include the workflow ID.

def to_json_dict(self) -> Dict[str, Any]: (source)

Convert this history to JSON-compatible dict.

Note, this does not include the workflow ID.

History events for the workflow.

workflow_id: str = (source)

ID of the workflow.

Run ID extracted from the first event.