Restart a failed workflow from a specific step
Hi!
I did not found any option to restart a failed workflow from a specific step.
For exemple something went wrong in a step and the workflow ended. I would want to be able to restart the workflow at this specific step then the workflow would follow its normal path.
Also is it possible to re execute one step without executing the rest of the flow.
Thx for the help!
Hello,
I think it is not possible at the moment, but you can use Saga transactions to re-execute failed step. https://github.com/danielgerlag/workflow-core/wiki/09.-Saga-Transactions. If you set retry, it should not continue to next step when step fails (exception is thrown).
Yeah I know but I plugged a user interface on the workflow engine and I wanted to be able to manually replay specific steps.
Same for errors it would have been really nice to be able for Retry mechanism to be able set a maximum of retry and the outcoming when the max retry number is reached. Something that could be defined like that:
.OnError(WorkflowErrorHandling.Retry, TimeSpan.FromSeconds(10), maxRetry: 10, outcome: WorkflowErrorHandling.Compensate)
It is good idea and as I see, someone already asked for this functionality in issue #206. This is the answer https://github.com/danielgerlag/workflow-core/issues/206#issuecomment-443956314. That issue is still open, so I think this is not possible at the moment. I think that @danielgerlag is little bit busy these days. So, it would be possible only if someone will code it and creates new pull request.
I have been using the WorkflowCore extensively, I can only tell that many times , rerunning the step is not possible. The only way I can think of is to have the steps an optional param to make it re run after failure.