Specific activity retry

Hi Team

Is there any way in Java SDK to retry only specific failed activity rather than using Workflow reset option where it executes all remaining activities starting from the failed once.


Hi @Faizan_Kamal
help us understand your use case better - why do you need workflow reset/retry? Could you not add a retry policy on activity options of your specific activity and then keep retrying until it is successful? You can also define non retryable errors via the RetryOptions setDoNotRetry method.

Hi Tihomir,

Is there any way to cancel/fail the workflow from the workflow method using Java SDK.

Yes, you throw an ApplicationFailure exception from the workflow code to fail a workflow.

Cancellation is by definition an external request to a workflow to cancel. So initiating it from within a workflow code doesn’t make sense.