How to Replay a Activity after failure from externally

How can i replay the activity after failure. use-case is if some workflows get failed due to activity failure. how can i replay those failed activities externally. @tihomir @maxim

We don’t recommend failing workflows on activity failures. Activities can be retried as long as needed in Temporal.

If workflow already failed, then you can use the reset feature to restart it from a point before the activity invocation.

Actually i have written 3 activities with defined number of retries. like 1 activity will retry for 4 times after that it will be failed. so in my use-case i have to resume that particular activity which has been failed after maximum retry attempts, but the rest two should not be executed while reset or resume of that failed activity, state should be manage for other two activities in reset of that specific activity from its failure point. can you show me any piece of code for the same in JAVA SDK. i am unable to find something related to resume failure activity, and state management.

Do I understand correctly that you require a human intervention to retry that particular activity again?

You can catch the activity failure and wait for a signal to retry it from the workflow. Here is an example that implements such logic as an interceptor:

The meta point is to not rely on workflow reset and other admin operations if human intervention is part of your business logic. Make this part of your workflow definition.

No, i don’t want human intervention. actually i want to build Utility which should be eligible to check workflows with failed activities, if it founds then it would retrigger them from failed activities. or 2 case:- if development of such utility is not possible then i need to implement same use case in existing architecture, like as you mentioned above need to catch those failure activities and need to retrigger them. but problem is when i try to start workflow continueasnew it not getting executed as i expected. attaching Snippets for example.

You can modify the interceptor example I posted earlier to update a search attribute with type of activity that failed and then wait for a signal. Then you can use batch signal operation to unblock these workflows. All this can automated.