We consider gas flow in pipe networks governed by the isothermal Euler equations. A set of coupling conditions is required to completely specify the Riemann problem at the junction. The momentum-related condition has no obvious expression and different approaches have been used in previous work. For the condition of equal momentum flux, Colombo and Garavello [A well posed Riemann problem for the p-system at a junction, Netw. Heterog. Media 1 (2006) 495–511] proved existence and uniqueness of solutions globally in time and locally in the subsonic region of the state space. If the entropy constraint is not considered, we are able to prove existence and uniqueness globally in the subsonic region for any momentum-related coupling constant satisfying a monotonicity requirement. The previously suggested conditions of equal pressure and equal momentum flux satisfy this requirement, but in general they both fail to fulfill the entropy constraint. The classical Bernoulli invariant is a natural scalar formulation of momentum conservation under ideal flow conditions. Our analysis shows that this invariant is monotone and unconditionally leads to solutions satisfying the entropy constraint. Of the coupling constants considered, this is therefore the only choice that guarantees the unique existence of entropy solutions to the N-junction Riemann problem for all initial data in the subsonic region.