@@ -2881,13 +2881,17 @@ async def workflow_handle(self) -> WorkflowHandle[SelfType, ReturnType]:
2881
2881
2882
2882
2883
2883
class ActivityExecutionAsyncIterator :
2884
- """Asynchronous iterator for :py:class:`ActivityExecution` values."""
2884
+ """Asynchronous iterator for activity execution values.
2885
+
2886
+ Returns either :py:class:`ActivityExecution` (for standalone activities) or
2887
+ :py:class:`WorkflowActivityExecution` (for activities started by workflows).
2888
+ """
2885
2889
2886
2890
def __aiter__ (self ) -> ActivityExecutionAsyncIterator :
2887
2891
"""Return self as the iterator."""
2888
2892
return self
2889
2893
2890
- async def __anext__ (self ) -> ActivityExecution :
2894
+ async def __anext__ (self ) -> Union [ ActivityExecution , WorkflowActivityExecution ] :
2891
2895
"""Return the next execution on this iterator.
2892
2896
2893
2897
Fetch next page if necessary.
@@ -2899,7 +2903,7 @@ async def __anext__(self) -> ActivityExecution:
2899
2903
# https://github.com/temporalio/api/pull/640/files
2900
2904
@dataclass (frozen = True )
2901
2905
class ActivityExecution :
2902
- """Info for a single activity execution from list response."""
2906
+ """Info for a standalone activity execution from list response."""
2903
2907
2904
2908
activity_id : str
2905
2909
"""Activity ID."""
@@ -2932,6 +2936,41 @@ class ActivityExecution:
2932
2936
"""Duration from scheduled to close time, only populated if closed."""
2933
2937
2934
2938
2939
+ @dataclass (frozen = True )
2940
+ class WorkflowActivityExecution :
2941
+ """Info for a workflow activity execution from list response."""
2942
+
2943
+ activity_id : str
2944
+ """Activity ID."""
2945
+
2946
+ run_id : str
2947
+ """Run ID of the activity."""
2948
+
2949
+ activity_type : str
2950
+ """Type name of the activity."""
2951
+
2952
+ workflow_id : str
2953
+ """ID of the workflow that started this activity."""
2954
+
2955
+ workflow_run_id : Optional [str ]
2956
+ """Run ID of the workflow that started this activity."""
2957
+
2958
+ scheduled_time : datetime
2959
+ """Time the activity was originally scheduled."""
2960
+
2961
+ close_time : Optional [datetime ]
2962
+ """Time the activity reached a terminal status, if closed."""
2963
+
2964
+ status : temporalio .common .ActivityExecutionStatus
2965
+ """Current status of the activity."""
2966
+
2967
+ task_queue : str
2968
+ """Task queue the activity was scheduled on."""
2969
+
2970
+ execution_duration : Optional [timedelta ]
2971
+ """Duration from scheduled to close time, only populated if closed."""
2972
+
2973
+
2935
2974
@dataclass (frozen = True )
2936
2975
class ActivityExecutionDescription :
2937
2976
"""Detailed information about an activity execution from describe response."""
0 commit comments