Resubmit failed aynch activity

Hi All,

I have below attached flow . Where i am using aynch activity ( waiting for it to closed once a corresponding correlation message is received ) .

I may fail the activity completeExceptionally incase of specific errors and once the erros fixed want to
tctl wf reset --wid $myid --reason “some” --reset_type LastWorkflowTask use the tctl command to resibmit . When i am trying to resubmit lastworkflow task i am getting below RETRY_STATE_MAXIMUM_ATTEMPTS_REACHED exception . How to resubmit the failed actibity again .

io.temporal.failure.ActivityFailure: scheduledEventId=11, startedEventId=12, activityType=‘IdentifyMarketplacedoc’, activityId=‘d04ad5b1-b95b-345e-b780-34097372d08c’, identity=’’, retryState=RETRY_STATE_MAXIMUM_ATTEMPTS_REACHED

io.temporal.failure.ActivityFailure: scheduledEventId=11, startedEventId=12, activityType=‘IdentifyMarketplacedoc’, activityId=‘d04ad5b1-b95b-345e-b780-34097372d08c’, identity=’’, retryState=RETRY_STATE_MAXIMUM_ATTEMPTS_REACHED

It looks like the activity failed more times that the RetryOptions.maxAttempts specified. Would you execute tctl workflow describe to see the last failure for the activity in the list of pending activities? Try executing it before the activity has timed out.

Hi Max,

This is aync activity waiting is complete with exception as below .

client.newActivityCompletionClient().completeExceptionally(decodedString, ApplicationFailure. newFailure (“foo”, “bar”, “data1” ));

after that i am trying to reset the same activity to with below command .

tctl workflow reset -w parent-workflow-32323232-0005 -r df6b212b-168c-4870-b251-2f27099281d6 --event_id 18 --reason “some_reason”

tctl workflow describe -w parent-workflow-32323232-0005
{
“executionConfig”: {
“taskQueue”: {
“name”: “OrderorchestartionWorkflowQueue”,
“kind”: “Normal”
},
“workflowExecutionTimeout”: “0s”,
“workflowRunTimeout”: “0s”,
“defaultWorkflowTaskTimeout”: “10s”
},
“workflowExecutionInfo”: {
“execution”: {
“workflowId”: “parent-workflow-32323232-0005”,
“runId”: “998ef64a-ccd9-49ac-a736-19628fc24c94”
},
“type”: {
“name”: “OrderorchestartionWorkflowInterface”
},
“startTime”: “2021-08-23T13:08:23.086588200Z”,
“closeTime”: “2021-08-23T13:08:23.277847300Z”,
“status”: “Failed”,
“historyLength”: “23”,
“memo”: {

},
"autoResetPoints": {

},
"stateTransitionCount": "4"

}
}

I don’t think you want to use reset here. What is wrong with keep retrying activity forever until the errors are fixed?

Hi Max,

Thank you for quick response . Below is the requirement .

workflow —> activity → kafak req topic —> micro service —> kafa response topic → activity continue

When there is some issue at micro service end they will send a response with retry option and we need to fail the workflow once the issue fixed at the micro service we need to replay failed activity with the same payload . We cant keep sending the same payload to the topic we sent and it failed and let support restart when they get acknowledgement from micro service team .

Thanks
phani

In this case, I wouldn’t use workflow failure and then reset. I would code this interaction into the workflow code directly. I would block your workflow on the activity failure waiting for a signal that indicates that this activity has to retry.

sure . Sounds like a good approach . But i just tried terminating the workflow and reset from last failed-point and everything worked as expected .

Thanks
phani