feat: add retry count handling and improve step status management in workflow