Skip to content

Commit 544b982

Browse files
committed
Add to workflow describe
1 parent d842dad commit 544b982

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

temporalio/client.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2411,16 +2411,27 @@ class WorkflowExecutionDescription(WorkflowExecution):
24112411

24122412
raw_description: temporalio.api.workflowservice.v1.DescribeWorkflowExecutionResponse
24132413
"""Underlying protobuf description."""
2414+
static_summary: Optional[str]
2415+
"""Gets the single-line fixed summary for this workflow execution that may appear in
2416+
UI/CLI. This can be in single-line Temporal markdown format."""
2417+
static_details: Optional[str]
2418+
"""Gets the general fixed details for this workflow execution that may appear in UI/CLI.
2419+
This can be in Temporal markdown format and can span multiple lines."""
24142420

24152421
@staticmethod
2416-
def _from_raw_description(
2422+
async def _from_raw_description(
24172423
description: temporalio.api.workflowservice.v1.DescribeWorkflowExecutionResponse,
24182424
converter: temporalio.converter.DataConverter,
24192425
) -> WorkflowExecutionDescription:
2426+
(summ, deets) = await converter._decode_user_metadata(
2427+
description.execution_config.user_metadata
2428+
)
24202429
return WorkflowExecutionDescription._from_raw_info( # type: ignore
24212430
description.workflow_execution_info,
24222431
converter,
24232432
raw_description=description,
2433+
static_summary=summ,
2434+
static_details=deets,
24242435
)
24252436

24262437

@@ -5199,7 +5210,7 @@ async def cancel_workflow(self, input: CancelWorkflowInput) -> None:
51995210
async def describe_workflow(
52005211
self, input: DescribeWorkflowInput
52015212
) -> WorkflowExecutionDescription:
5202-
return WorkflowExecutionDescription._from_raw_description(
5213+
return await WorkflowExecutionDescription._from_raw_description(
52035214
await self._client.workflow_service.describe_workflow_execution(
52045215
temporalio.api.workflowservice.v1.DescribeWorkflowExecutionRequest(
52055216
namespace=self._client.namespace,

tests/worker/test_workflow.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
from temporalio.api.workflowservice.v1 import (
4747
GetWorkflowExecutionHistoryRequest,
4848
ResetStickyTaskQueueRequest,
49+
DescribeWorkflowExecutionRequest
4950
)
5051
from temporalio.bridge.proto.workflow_activation import WorkflowActivation
5152
from temporalio.bridge.proto.workflow_completion import WorkflowActivationCompletion
@@ -6282,3 +6283,7 @@ async def waiting() -> bool:
62826283
PayloadConverter.default.from_payload(event.user_metadata.summary)
62836284
)
62846285
assert timer_summs == {"hi!", "timer2"}
6286+
6287+
describe_r = await handle.describe()
6288+
assert describe_r.static_summary == "cool workflow bro"
6289+
assert describe_r.static_details == "xtremely detailed"

0 commit comments

Comments
 (0)