SummaryIn this article, we address the task of setting up an optimal production plan taking into account an uncertain demand. The energy system is represented by a system of hyperbolic partial differential equations and the uncertain demand stream is captured by an Ornstein‐Uhlenbeck process. We determine the optimal inflow depending on the producer's risk preferences. The resulting output is intended to optimally match the stochastic demand for the given risk criteria. We use uncertainty quantification for an adaptation to different levels of risk aversion. More precisely, we use two types of chance constraints to formulate the requirement of demand satisfaction at a prescribed probability level. In a numerical analysis, we analyze the chance constrained optimization problem for the Telegrapher's equation and a real‐world coupled gas‐to‐power network.