Activity Cancellation Heartbeat

Hey!

I have a doubt, I added heartbeat to my activities in order to detect cancelations in order to be able to stop the activity process and execute some kind of gracefull shutdown

But I have the next question, is it mandatory to define heartbeat timeout for the activities?, I wonder this because I executed my workflows and the activities are properly pushing the hearbeat and also catching the cancelation properly

Is it mandatory to set the hearbeat timeout or is it optional?

Java SDK heartbeats once a minute when heartbeat timeout is not set. I would recommend setting the heartbeat timeout. Without it, the activity will not timeout for the duration of StartToClose timeout in the case of worker crashes.