How to set heartbeat timeout to handle heart beats and cancellation

Parent workflow → Child workflow using Async.procedure and promise.get()
Child workflow has a Sync activity that heartbeats every second.

With a heartbeat time out of 5seconds, we are seeing random heartbeat timeout errors
With a higher heartbeat time, cancellation doesn’t take effect until 80% of the heartbeat time out due to throttling.

We are using 1.0.7 temporal-sdk in java and unfortunately our temporal is on 1.23.1
We had to upgrade temporal server recently to fix security vulnerabilities but yet to upgrade the SDK

Also, does the heartbeat message/payload matter? I was sending the same heartbeat message in all heartbeats.

Any help would be greatly appreciated!

Modified the way in which Activity is invoked in child workflow. Invoked it now in asynchronous way and waiting on promise.get and I don’t see the heartbeat failures anymore.

How did this work?

The behavior you observerd is by design. Heartbeats are throttled up to 80% of the heartbeat timeout. Changing how an activity is invoked from the workflow doesn’t affect theactivity execution behavior (including heartbeating) at all.