workflow rewrite