We present a challenging flow-chemistry experiment concerning the synthesis of diphenyldiazomethane using the Omura-Sharma-Swern oxidation, that we have developed and used in our second-year undergraduate lab classes over the past seven years. The experiment integrates a number of different aspects and concepts of chemistry that are traditionally taught as separate subjects in undergraduate chemical education: organic synthesis, quantitative chemical analysis, design of experiments, optimization, statistical modelling, computer programming and continuous-flow processes.