Refactored as the worflow APIs in 3.0.x are not consistent with those in
3.1.x.