@@ -156,6 +156,7 @@ def get_activity():
156156 }
157157 if event .activity_id not in self ._activities :
158158 activity ["retry" ] = 0
159+ activity ["attempt" ] = 1
159160 self ._activities [event .activity_id ] = activity
160161 self ._tasks .append (activity )
161162 else :
@@ -166,6 +167,7 @@ def get_activity():
166167 # corresponds to the last execution.
167168 self ._activities [event .activity_id ].update (activity )
168169 self ._activities [event .activity_id ]["retry" ] += 1
170+ self ._activities [event .activity_id ]["attempt" ] += 1
169171 elif event .state == "schedule_failed" :
170172 activity = {
171173 "type" : "activity" ,
@@ -305,6 +307,7 @@ def get_workflow():
305307 }
306308 if event .workflow_id not in self ._child_workflows :
307309 workflow ["retry" ] = 0
310+ workflow ["attempt" ] = 1
308311 self ._child_workflows [event .workflow_id ] = workflow
309312 self ._tasks .append (workflow )
310313 else :
@@ -318,6 +321,7 @@ def get_workflow():
318321 )
319322 self ._child_workflows [event .workflow_id ].update (workflow )
320323 self ._child_workflows [event .workflow_id ]["retry" ] += 1
324+ self ._child_workflows [event .workflow_id ]["attempt" ] += 1
321325 elif event .state == "start_failed" :
322326 workflow = {
323327 "type" : "child_workflow" ,
0 commit comments