We study forward dijet production in dilute-dense hadronic collisions. By considering the appropriate limits, we show that both the transverse-momentum-dependent (TMD) and the high-energy factorization formulas can be derived from the Color Glass Condensate framework. Respectively, this happens when the transverse momentum imbalance of the dijet system, k t , is of the order of either the saturation scale, or the hard jet momenta, the former being always much smaller than the latter. We propose a new formula for forward dijets that encompasses both situations and is therefore applicable regardless of the magnitude of k t . That involves generalizing the TMD factorization formula for dijet production to the case where the incoming small-x gluon is off-shell. The derivation is performed in two independent ways, using either Feynman diagram techniques, or color-ordered amplitudes.