Workflow Task Heartbeating behavior with multiple sequential Local Activities

Hey everyone :waving_hand:

I have a workflow that runs multiple sequential Local Activities, each taking ~2 seconds. I understand that Workflow Task Heartbeating kicks in automatically when a Local Activity takes longer than 80% of the Workflow Task Timeout (i.e., >8s with the default 10s WFT timeout).

My question is about the exact trigger point for Workflow Task Heartbeating when running several short Local Activities in sequence:

  • Does the 80% threshold apply to the total elapsed time of the Workflow Task (i.e., across all Local Activities combined), or only to a single Local Activity’s execution time?

  • Specifically: if I’m between two Local Activities (one just finished, the next hasn’t started yet) and the total elapsed time has already exceeded 80% of the WFT timeout — will a Workflow Task Heartbeat be triggered at that point?

Context: I have 5 Local Activities × ~2s each = ~10s total, which exceeds the 8s threshold. I want to understand whether the heartbeat fires mid-sequence or only while a Local Activity is actively running.

Thanks!

Does the 80% threshold apply to the total elapsed time of the Workflow Task (i.e., across all Local Activities combined), or only to a single Local Activity’s execution time?

Sdk can check if it needs to extend workflow task while local activity is dispatched (so dispatched + running, until it completes) , so its per single local activity execution within that workflow task

Specifically: if I’m between two Local Activities (one just finished, the next hasn’t started yet) and the total elapsed time has already exceeded 80% of the WFT timeout — will a Workflow Task Heartbeat be triggered at that point?

not in-between, but when worker starts dispatching and executing next local activity, it will detect that it reached 80% workflow task timeout and at that point send workflow task heartbeat

Context: I have 5 Local Activities × ~2s each = ~10s total, which exceeds the 8s threshold. I want to understand whether the heartbeat fires mid-sequence or only while a Local Activity is actively running.

while its dispatched and running, so if your local activity 4 completes at lets say 8.1s into workflow task, worker will detect that while this 4th local activity is running and issue workflow task heartbeat
if 4th activity completes lets say right at 8s or 7.9s, worker will dispatch local activity 5, and then learn that it needs to send workflow task heartbeat
note that local activity 5 is not re-executed in new workflow task requested by sdk, it will continue running

hope this helps