Biochemical refinery problems often involve uncertainty such as randomness in materials, reactions, and operations. In this work we establish a multistage stochastic programming model for the optimization and control of chemical processes under this type of uncertainty. We discuss the implementation of a stochastic dual dynamic programming (SDDP) algorithm to compute an optimal solution for this problem. We then applied the algorithm on a simulated lignin depolymerization process to test the efficiency under several conditions.