This is an open access article under the terms of the Creative Commons Attribution License, which permits use, distribution and reproduction in any medium, provided the original work is properly cited.The demand for sustainable energy sources, like biomass, solar energy, hydro and wind power, is connected to challenges like energy storage and fluctuating energy supply. Regarding the second challenge, industry has to evolve their existing processes from steady state processes to dynamic ones. This work is concerned with the conception of an inline spectroscopy-based optimization routine for chemical reactions under dynamic process conditions, which implements the search for a well applicable optimization algorithm. The studied reaction to reach this goal is a nitroaldol condensation.