Improve code generation according to workflows