From 2d48bb8f3898dc8d92b27fe1c5bc0bdf8c05a9c1 Mon Sep 17 00:00:00 2001 From: Andrew Yuan Date: Wed, 2 Sep 2026 10:41:55 -0400 Subject: [PATCH] Document missing root namespace Root execution data omits the namespace, which may differ for cross-namespace child workflows. Warn users to retain it separately. --- temporalio/client/_workflow.py | 12 ++++++++++-- temporalio/workflow/_context.py | 8 +++++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/temporalio/client/_workflow.py b/temporalio/client/_workflow.py index 0607ade0a..8bbb67f69 100644 --- a/temporalio/client/_workflow.py +++ b/temporalio/client/_workflow.py @@ -1255,10 +1255,18 @@ class WorkflowExecution: """Run ID for the parent workflow if this was started as a child.""" root_id: str | None - """ID for the root workflow.""" + """ID for the root workflow. + + The root namespace is not retained and may differ from this workflow's namespace for + cross-namespace child workflows. Track it separately if needed. + """ root_run_id: str | None - """Run ID for the root workflow.""" + """Run ID for the root workflow. + + The root namespace is not retained and may differ from this workflow's namespace for + cross-namespace child workflows. Track it separately if needed. + """ raw_info: temporalio.api.workflow.v1.WorkflowExecutionInfo """Underlying protobuf info.""" diff --git a/temporalio/workflow/_context.py b/temporalio/workflow/_context.py index b33f83150..c9daaf670 100644 --- a/temporalio/workflow/_context.py +++ b/temporalio/workflow/_context.py @@ -92,6 +92,8 @@ class Info: namespace: str parent: ParentInfo | None root: RootInfo | None + """Root information. Its namespace is not retained and may differ from this workflow's + namespace for cross-namespace child workflows. Track it separately if needed.""" priority: temporalio.common.Priority """The priority of this workflow execution. If not set, or this server predates priorities, then returns a default instance.""" @@ -217,7 +219,11 @@ class ParentInfo: @dataclass(frozen=True) class RootInfo: - """Information about the root workflow.""" + """Information about the root workflow. + + The namespace is not retained and may differ from the current workflow's namespace for + cross-namespace child workflows. Track it separately if needed. + """ run_id: str workflow_id: str