We generalize the scattering approach to quantum graphs to quantum graphs with piecewise constant potentials and multiple excitation modes. The free single-mode case is well-known and leads to the trace formulas of Roth (1983 C. R. Acad. Sci., Paris I 296 793-5), Kottos and Smilansky (1997 Phys. Rev. Lett. 79 4794). By introducing an effective reduced scattering picture we are able to propose new exact trace formulas in the more general settings. The latter are derived and discussed in details with some numerical examples for illustration. Our generalization is motivated by both experimental applications and fundamental theoretical considerations. The free single-mode quantum graphs are an extreme idealization of reality that, due to the simplicity of the model allows to understand a large number of generic or universal phenomena. We lift some of this idealization by considering the influence of evanescent modes that only open above threshold energies. How to do this theoretically in a closed model in general is a challenging question of fundamental theoretical interest and we achieve this here for quantum graphs.