Currently I have a workflow that has been opened and it is still in progress.
Due to some business logic, I want to restart the workflow from the beginning using the same workflowId.
If I try to call WorkflowClient.start(…), I get the following error:
Caused by: io.grpc.StatusRuntimeException: ALREADY_EXISTS: Workflow execution is already running
Is there a way to restart a workflow? How do I do that with the Java SDK?
There are multiple ways to restart a workflow. You can either terminate the previous run and start it again.
Another option is to reset the workflow to its first workflow task.
Awesome. You mentioned there’s a reset workflow option through the CLI but I can’t seem to find that in the sdk-java. Could you point me to it? Thanks.
Hi @maxim,
I also need to restart a workflow by using Go SDK but I was not able to find the suggested method “untyped workflow stub” in the related SDK. Could you point me to the right code section?
Thanks in advance
Hi Maxim. How do i create request object which is passed to resetWorkflowExecution method.
Is there any jar i need to download for Java to create object of ResetWorfklowExecutionRequest. Please help
Hi Maxim. I was able to resolve the error. But my workflow which is in failure status is not getting restarted from the failure point. Can you please let me know what value i need to pass in setWorkflowTaskFinishEventId method.
Thanks Maxim. I was able to finally reset the workflow. But the new workflow keeps on running.
Status is running and in the history the last step displaying is WorkflowTaskScheduled.