We study the Anomaly flow on 2-step nilmanifolds with respect to any Hermitian connection in the Gauduchon line. In the case of flat holomorphic bundle, the general solution to the Anomaly flow is given for any initial invariant Hermitian metric. The solutions depend on two constants K1 and K2, and we study the qualitative behaviour of the Anomaly flow in terms of their signs, as well as the convergence in Gromov-Hausdorff topology. The sign of K1 is related to the conformal invariant introduced by Fu, Wang and Wu. In the non-flat case, we find the general evolution equations of the Anomaly flow under certain initial assumptions. This allows us to detect non-flat solutions to the Hull-Strominger-Ivanov system on a concrete nilmanifold, which appear as stationary points of the Anomaly flow with respect to the Strominger-Bismut connection. Contents 1. Introduction 1 2. Preliminaries 4 2.1. Adapted bases 5 2.2. Trace of the curvature 7 3. The first Anomaly flow equation on nilpotent Lie groups 10 3.1. Special Hermitian metrics along the flow 12 3.2. Reduction to almost diagonal initial metrics and the general solution 13 4. The Anomaly flow with flat holomorphic bundle 15 4.1. Qualitative behaviour of the model problem 15 4.2. The sign of K 1 and its relation to the Fu-Wang-Wu conformal invariant 18 4.3. Convergence of the nilmanifolds 19 5. Evolution of the holomorphic vector bundle 20 5.1. Anomaly flow on N 3 and solutions to the Hull-Strominger-Ivanov system 23 6. Appendix A 27 7. Appendix B 29 References 32