Minimizing the waste stream associated with the synthesis of active pharmaceutical ingredients (APIs) and commodity chemicals is of high interest within the chemical industry from an economic and environmental perspective. In exploring solutions to this area, we herein report a highly optimized and environmentally conscious continuous-flow synthesis of two APIs identified as essential medicines by the World Health Organization, namely diazepam and atropine. Notably, these approaches significantly reduced the E-factor of previously published routes through the combination of continuous-flow chemistry techniques, computational calculations and solvent minimization. The E-factor associated with the synthesis of atropine was reduced by 94-fold (about two orders of magnitude), from 2245 to 24, while the E-factor for the synthesis of diazepam was reduced by 4-fold, from 36 to 9.