The dynamic control of the heat exchanger network is important for developing energy‐efficient and safe industrial processes. In such a system, the control is achieved through the bypass stream around the heat exchanger. This work aims to track the setpoint temperature of the mixed stream by manipulating the bypass fraction of the cold stream around the heat exchanger. The implemented control is in a non‐linear model predictive control (NMPC) framework. The first‐principles model of a shell and a tube heat exchanger is used. The orthogonal collocation technique is used to discretize the first‐principles model into the system of algebraic equations. In this work, uncertainty is also considered in the inlet temperature of the hot stream. The uncertain optimal control problem is dealt with by using a scenario tree‐based approximation along with the affine policy‐based method. The results show that, under different scenarios of uncertainty, the controlled variable efficiently tracks the setpoint. In comparison, considering the same scenarios of uncertainty used, the deterministic optimization approach shows significant deviation in the controlled variable from the setpoint as time passes.