While continuous chemical processes have attracted both academic and industrial interest, virtually all active pharmaceutical ingredients (APIs) are still produced by using multiple distinct batch processes. To date, methods for the divergent multistep continuous production of customizable small molecules are not available. A chemical assembly system was developed, in which flow-reaction modules are linked together in an interchangeable fashion to give access to a wide breadth of chemical space. Control at three different levels--choice of starting material, reagent, or order of reaction modules--enables the synthesis of five APIs that represent three different structural classes (γ-amino acids, γ-lactams, β-amino acids), including the blockbuster drugs Lyrica and Gabapentin, in good overall yields (49-75%).