Temporal Local Activity cancellation points

I use local activities in my workflow, and each activity has a Start-to-Close timeout set for it. These activities have heavy business logic, and my concern is they will continue to execute well beyond the set timeout. Are there cancellation points defined for Local Activities that I can use to periodically check to see if there is a Timeout received for the activity?

Don’t use local activities for “heavy business logic” that requires cancellation.

We can move to using non-local regular activities if required. Are there cancellation points defined for regular activities, where the activity can receive timeouts? I saw this example in one of the posts https://github.com/tsurdilo/temporal-cancel-activity/blob/main/src/main/java/io/temporaldemo/TemporalActivity.java

and is context.heartbeat(i); a cancellation point?

The only way cancellation is delivered to Java activity is through a heartbeat call throwing an exception.

Note that heartbeats are sent to the service only if the heartbeat timeout is set.

1 Like