Skip to content

Conversation

@aneetakolhe
Copy link

What was changed

This PR enhances the existing ActivityHeartbeatingCancellation sample by
demonstrating how Activity heartbeats can be combined with RetryPolicy
configured at the workflow level.

Why?

This helps .NET developers understand best practices for long-running,
resumable activities.

Checklist

  • Add RetryPolicy to the activity execution in MyWorkflow
  • Ensure heartbeat progress is sent from the activity
  • Update README to explain how retry and heartbeats work together
  1. Closes

  2. How was this tested:
    Documentation change

  3. Any docs updates needed?

…mple by demonstrating how Activity heartbeats interact with RetryPolicy configured at the workflow level.
@aneetakolhe aneetakolhe requested a review from a team as a code owner December 12, 2025 14:02
@CLAassistant
Copy link

CLAassistant commented Dec 12, 2025

CLA assistant check
All committers have signed the CLA.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Comment on lines +37 to +40
## How to Run

1. Start Temporal locally (`temporalite start`).
2. Run the worker:
Copy link
Member

@cretz cretz Dec 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be incomplete and we don't use "temporalite" (other samples say to look at primary README for prerequisites to setup server)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, agreed. I’ll align this README with other samples by removing the temporalite mention and pointing to the primary README prerequisites for running a Temporal server.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if this really deserves to be a sample though. It's simply showing how to change two defaults for a RetryPolicy property, correct? Not sure it relates to heartbeat/cancellation or that it deserves a sample to show how to set retry policy settings.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the feedback to all comments. Makes sense. I understand the desire to keep the sample narrowly focused.
I’ll close this PR. Appreciate the review and discussion.

in Temporal's .NET SDK.

## What This Sample Shows
- How to configure retry settings for an activity.
Copy link
Member

@cretz cretz Dec 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heartbeating sample seems unrelated to retry settings that you may want to set whether or not you heartbeat. Is this addition to the sample only for showing that you can set the RetryOptions property? This can be set regardless. I am not sure it makes sense in a heartbeating/cancellation sample to demonstrate that this setting can be set (any more than any other activity option setting).

Comment on lines +17 to +20
MaximumAttempts = 3,
InitialInterval = TimeSpan.FromSeconds(1),
BackoffCoefficient = 2.0,
MaximumInterval = TimeSpan.FromSeconds(10)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two of these are the defaults already, and the other two are just choices a user may make regardless of heartbeating/cancellation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants