Similarly, N-Boc piperidinone was a competent substrate for this protocol affording the deuterated product 20 in 44% yield. Finally, in an effort to demonstrate the applicability of this method to the late-stage functionalization of some medicinally relevant molecules, we subjected several biologically active molecules to our two-step flow protocol. N-methyl-2pyrrolidone, often used in the formulation of drugs for both oral and transdermal delivery routes, could be regioselectively functionalized at the endocyclic -to-N position (21, 52%). Also the terpenoid ambroxide (22, 40% yield) and the nootropic drug aniracetam (23, 20% yield) could be efficiently decorated with a deuterated allyl moiety. In a similar vein, we turned our attention to introduce aromatic and aliphatic aldehydes in the second step, yielding trisubstituted allyl moieties, which are particularly challenging to synthesize. By exploiting our modular protocol, a virtually limitless array of substituents can be systematically introduced (Scheme 3). Due to steric hindrance, prolonged reaction times (~ 3 hours) were required to obtain full conversion and thus a fed-batch approach was adopted (Scheme 2). Using this strategy, the expected olefin 24 was obtained in 60% yield (d.r. 2:1) when the reaction stream exiting the photoreactor was added to a stirring solution of benzaldehyde (1.5 equiv) and LiOtBu (1.1 equiv) in tetrahydrofuran. In general, aromatic aldehydes bearing electron-withdrawing substituents required shorter reaction times (e.g., 26-30) and the presence of ortho-substituents resulted in higher E-to-Z ratios (e.g., 31, 33 and 36).