We address in this paper the mid-term planning of chemical complexes with integration of stochastic inventory management under supply and demand uncertainty. By using the guaranteed service approach to model the time delays in the chemical flows inside the chemical process network, we capture the stochastic nature of the supply and demand variations, and develop an equivalent deterministic optimization model to minimize the total cost including production cost, feedstock purchase cost, cycle inventory and safety stock costs. The model simultaneously determines the optimal purchases of the feedstocks, production levels of the processes, sales of final products and safety stock levels of all the chemicals, as well as the internal demand of the production processes. The model also captures “risk-pooling” effects to allow centralization of inventory management for chemicals that are consumed/produced by multiple processes. We formulate the model as a mixed-integer nonlinear program (MINLP) with a nonconvex objective function and nonconvex constraints. To solve the global optimization problem with modest computational times, we exploit some model properties and develop a tailored branch-and-refine algorithm based on successive piece-wise linear approximation. Five examples are presented to illustrate the application of the models and the performance of the proposed algorithm.</p