Skip to content
Closed
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
5 changes: 5 additions & 0 deletions changelog/added/unbrewed-kami.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Add experimental `activity.Info.workflow_task`, the Workflow Task attempt in which a Worker dispatched a Local Activity.
Core: A local activity's `ActivityTask.Start` has `workflow_task` (field 21), with the started event id, attempt and start time of the workflow task in which Core dispatched it. `workflow_task` also has `previous_started_event_id`, `previous_attempt` and `previous_started_time` of the run's last completed workflow task, and `failed_tasks`, the started event ids of the run's last 100 failed or timed out workflow tasks. Retries that Core runs locally keep the value. Core leaves it unset for other activities.
Core: Experimental external storage drivers now receive the workflow or standalone activity a payload is stored for, as the `target` on `StorageDriverStoreContext` and `StorageDriverSelectContext`.
Core: Experimental external storage (requires the `experimental` feature). `DataConverter::with_external_storage` offloads payloads at or above a size threshold to a user-supplied `StorageDriver`, replacing them in history with small references that workers and clients resolve transparently. See `ExternalStorage` for current limitations. This API may change without notice.
Core: Workers report the types of the external storage drivers configured on their client's data converter in worker heartbeats.
1 change: 1 addition & 0 deletions changelog/breaking-changes/unbrewed-kami.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Core: Core now rejects activation responses with a nondeterminism error if the activation contained only updates and the response rejects every update but also includes another workflow command. SDKs must return only update rejections when all validators reject an update-only activation.
6 changes: 6 additions & 0 deletions changelog/fixed/unbrewed-kami.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Core: Preserve queued queries across workflow eviction so requests for the same run are answered instead of silently dropped.
Core: Dev and test server startup now stops waiting at the configured deadline even if a readiness request stalls. Timeout messages include the last connection failure when available.
Core: Rejection-only update tasks no longer dispatch local activities resumed from replay before validation, allowing those tasks to remain unrecorded in workflow history.
Core: Preparing a legacy query now remains in replay mode, preventing unrecorded local activity attempts that could execute twice or leave the workflow stuck.
Core: Resource-based worker tuning now reads CPU usage and quotas from standard cgroup v1 mounts, preventing host CPU measurements from understating container load when cgroup v2 files are unavailable.
Core: Prevent Nexus worker shutdown from hanging if a task completion future is dropped or its response is rejected as malformed. Dropping an in-flight completion logs an error and panics when debug assertions are enabled; callers must still await completion to preserve RPC delivery.
38 changes: 38 additions & 0 deletions temporalio/activity.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,36 @@ def decorator(fn: CallableType) -> CallableType:
return decorator


@dataclass(frozen=True)
class WorkflowTaskAttempt:
"""One attempt of a Workflow Task.

.. warning::
This API is experimental.
"""

started_event_id: int
"""ID of the task's ``WorkflowTaskStarted`` event."""

attempt: int
"""Attempt of the task."""

started_time: datetime | None
"""When the server started the task. None if the server did not send it."""

previous_started_event_id: int = 0
"""ID of the ``WorkflowTaskStarted`` event of the run's last completed task. 0 if none."""

failed_tasks: Sequence[int] = ()
"""``WorkflowTaskStarted`` event IDs of the run's last 100 failed and timed out tasks."""

previous_attempt: int = 0
"""Attempt of the run's last completed task. 0 if no task has completed."""

previous_started_time: datetime | None = None
"""When the server started the run's last completed task. None if no task has completed."""


@dataclass(frozen=True)
class Info:
"""Information about the running activity.
Expand Down Expand Up @@ -141,6 +171,14 @@ class Info:
activity_run_id: str | None = None
"""Run ID of this activity. None for workflow activities."""

workflow_task: WorkflowTaskAttempt | None = None
"""For a local activity, the Workflow Task in which the Worker dispatched this execution.
Retries that the Worker runs in the same task have the same value. None for other activities.

.. warning::
This API is experimental.
"""

@property
def in_workflow(self) -> bool:
"""Was this activity started by a workflow?"""
Expand Down
20 changes: 10 additions & 10 deletions temporalio/api/activity/v1/message_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading