Retrying workflow errors
When a workflow has entered "Error" status due to an unhandled error, you can issue a Retry command to tell K2 to retry the failed instances of the workflow from the point at which it failed.
Retry will execute all the code or rules for the event, activity rule or line where the process failed. It will not start the process from scratch or restart execution from an earlier step of the workflow. If you want to “send the process back” or “skip” to a different step in the workflow, use the Go To Activity function in the Workflow Instances node instead. With a Retry, K2 executes the event/line/rule that failed again, so be careful if the event does multiple things like updating a DB and then calling a web service. It is possible that you could end up updating the database twice but calling the web service once, so understand the potential impact of issuing a retry command before you do so.
You can issue the Retry command from the Error Profiles View as well as the Workflow Instances view.
Using the Retry command
- From the Workflow Instances node, or from an Error profile, locate the workflow instance(s) in Error status that you wish to retry.
- Find the Workflow Instance you want to view and read the Description of the error. The description provides information on the error and may guide you to an underlying problem that needs to be addressed before you attempt to retry the workflow.
- To view the Full Details of the error, click the check box for the Workflow Instance and click Show Details.
- If necessary, investigate and resolve the underlying cause of the error.
- To Retry one or more instances, click the check box for the instance(s) you want to retry from the Error Logs view. The Retry button becomes available, click the button to issue the retry command.When selecting multiple instances to Retry, we recommend selecting instances in batches of at most 10 instances at a time, and then issuing the Retry command. This will help to reduce the load on the K2 sever when processing the Retry command for multiple instances at the same time, and can help to mitigate subsequent issues that may arise when multiple instances are retrying the same event, for example overloading a target system with multiple requests.
- The Error Logs view will refresh. If the error was resolved by the Retry command, the Workflow Instance will be removed from the list. Some errors may not clear immediately, and because of the way K2 works, if you issue a Retry command it is possible that the workflow could go into Error status again after a few seconds, once K2 has processed the failed code. We recommend that whenever you do Retry a failed workflow, wait a few seconds and then use the Refresh button to refresh the list of failed workflows, just to verify that the workflow error was indeed resolved by the Retry command.