The oil and gas industry has undergone a major transformation recently, thanks to advanced data analytics and machine learning (ML). These technologies have revolutionized reservoir engineering, enabling data-driven decisions and optimization of well completion parameters. Accurate forecasts for hydrocarbon production from unconventional reservoirs are crucial for energy security, economic growth, and sustainable resource management. This project introduces an innovative, automated multistep workflow that includes data collection, preparation, feature selection, hyperparameter tuning, ML algorithm selection, and well-completion parameter optimization. It also proposes new methods for outlier detection, feature selection, and a modified optimization algorithm. The workflow’s accuracy was validated using various synthetic and field databases, considering different objective functions like cumulative and monthly/daily production rates.