I derive a procedure to generate sum rules for the trace anomalies a and alpha'. Linear combinations of Deltaa = a(UV) - a(IR) and Deltaa' = a'(UV) - a'(IR) are expressed as multiple flow integrals of the two-, three- and four-point functions of the trace of the stress tensor. Eliminating Deltaa', universal flow invariants are obtained, in particular sum rules for Deltaa. The formulas hold in the most general renormalizable quantum field theory (unitary or not), interpolating between UV and IR conformal fixed points. I discuss the relevance of these sum rules for the issue of the irreversibility of the RG flow. The procedure can be generalized to derive sum rules for the trace anomaly c.