revert workflow state on error