Skip to content

Add first_execution_run_id to workflow info #1027

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions temporalio/worker/_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,7 @@ def _create_workflow_instance(
execution_timeout=init.workflow_execution_timeout.ToTimedelta()
if init.HasField("workflow_execution_timeout")
else None,
first_execution_run_id=init.first_execution_run_id,
headers=dict(init.headers),
namespace=self._namespace,
parent=parent,
Expand Down
1 change: 1 addition & 0 deletions temporalio/worker/workflow_sandbox/_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
continued_run_id=None,
cron_schedule=None,
execution_timeout=None,
first_execution_run_id="sandbox-validate-first-run_id",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
first_execution_run_id="sandbox-validate-first-run_id",
first_execution_run_id="sandbox-validate-first-execution-run-id",

headers={},
namespace="sandbox-validate-namespace",
parent=None,
Expand Down
1 change: 1 addition & 0 deletions temporalio/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,7 @@ class Info:
continued_run_id: Optional[str]
cron_schedule: Optional[str]
execution_timeout: Optional[timedelta]
first_execution_run_id: str
headers: Mapping[str, temporalio.api.common.v1.Payload]
namespace: str
parent: Optional[ParentInfo]
Expand Down
1 change: 1 addition & 0 deletions tests/worker/test_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -1645,6 +1645,7 @@ async def run(self, past_run_ids: List[str]) -> List[str]:
info = workflow.info()
if info.continued_run_id:
past_run_ids.append(info.continued_run_id)
assert info.first_execution_run_id == past_run_ids[0]
workflow.continue_as_new(
past_run_ids,
# Add memo and retry policy to check
Expand Down
Loading