Drug discovery is a long and costly process, in which the chemical synthesis of target compounds is a rate-limiting step. Recent academic breakthroughs have introduced artificial intelligence and robotics for drug discovery. Potential drug candidates can now be discovered by machine learning algorithms, a feasible synthesis pathway for compounds is predictable using large datasets and robots can perform automated synthesis. However, fully-automated synthesis of new drug candidates does not exist, since human input is required for finding appropriate reaction conditions. This research aims to bridge the gap between automatic synthesis planning and robotic synthesis execution with automatic generation of chemical recipes. We propose a data-driven method for optimizing reaction conditions and matching synthesis steps to enable multistep continuous-flow synthesis. A central database will be created and active learning will guide chemists to highly-informative data with minimal experiments. New models will be developed for predicting molecular and reaction properties, in order to predict reaction conditions. This new approach will be evaluated for two continuous-flow processes: benzaldehyde and lithiated methoxyallene production. Automating drug synthesis has the potential to speed up drug discovery in industrial laboratories and create large economic opportunities by first reducing R&D costs and then facilitating the development of more efficient production processes.