I've post about how to retry error in workflow with coding at https://medium.com/k2-dev-en/k2-workflow-error-retry-with-coding-6e0dc48b024c. Hope this can help in case you want to do something similar.
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.