diff --git a/changelog/fixed/napping-narwhal.md b/changelog/fixed/napping-narwhal.md new file mode 100644 index 0000000000..b6da01c848 --- /dev/null +++ b/changelog/fixed/napping-narwhal.md @@ -0,0 +1 @@ +`WorkflowHandle.describe()` no longer raises `ValueError` for a paused workflow; `WorkflowExecutionStatus` now includes `PAUSED`. diff --git a/temporalio/client/_workflow.py b/temporalio/client/_workflow.py index 8a2c423a50..cbe02b13df 100644 --- a/temporalio/client/_workflow.py +++ b/temporalio/client/_workflow.py @@ -1496,6 +1496,9 @@ class WorkflowExecutionStatus(IntEnum): TIMED_OUT = int( temporalio.api.enums.v1.WorkflowExecutionStatus.WORKFLOW_EXECUTION_STATUS_TIMED_OUT ) + PAUSED = int( + temporalio.api.enums.v1.WorkflowExecutionStatus.WORKFLOW_EXECUTION_STATUS_PAUSED + ) @dataclass diff --git a/tests/test_client.py b/tests/test_client.py index 7cc5377514..5e60ae79bf 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -15,6 +15,8 @@ from google.protobuf import json_format import temporalio.api.common.v1 +import temporalio.api.enums.v1 +import temporalio.api.workflow.v1 import temporalio.api.workflowservice.v1 import temporalio.common import temporalio.exceptions @@ -65,6 +67,7 @@ TaskReachabilityType, TerminateWorkflowInput, WorkflowContinuedAsNewError, + WorkflowExecution, WorkflowExecutionCount, WorkflowExecutionCountAggregationGroup, WorkflowExecutionStatus, @@ -368,6 +371,14 @@ async def test_describe( assert desc.root_run_id == desc.run_id +def test_workflow_execution_from_paused_info(): + info = temporalio.api.workflow.v1.WorkflowExecutionInfo( + status=temporalio.api.enums.v1.WorkflowExecutionStatus.WORKFLOW_EXECUTION_STATUS_PAUSED + ) + execution = WorkflowExecution._from_raw_info(info, "default", DataConverter.default) + assert execution.status == WorkflowExecutionStatus.PAUSED + + async def test_query(client: Client, worker: ExternalWorker): handle = await client.start_workflow( "kitchen_sink",