Predicting monthly streamflow is essential for hydrological analysis and water resource management. Recent advancements in deep learning, particularly long short-term memory (LSTM) and recurrent neural networks (RNN), exhibit extraordinary efficacy in streamflow forecasting. This study employs RNN and LSTM to construct data-driven streamflow forecasting models. Sensitivity analysis, utilizing the analysis of variance (ANOVA) method, also is crucial for model refinement and identification of critical variables. This study covers monthly streamflow data from 1979 to 2014, employing five distinct model structures to ascertain the most optimal configuration. Application of the models to the Zarrine River basin in northwest Iran, a major sub-basin of Lake Urmia, demonstrates the superior accuracy of the RNN algorithm over LSTM. At the outlet of the basin, quantitative evaluations demonstrate that the RNN model outperforms the LSTM model across all model structures. The S3 model, characterized by its inclusion of all input variable values and a four-month delay, exhibits notably exceptional performance in this aspect. The accuracy measures applicable in this particular context were RMSE (22.8), R2 (0.84), and NSE (0.8). This study highlights the Zarrine River’s substantial impact on variations in Lake Urmia’s water level. Furthermore, the ANOVA method demonstrates exceptional performance in discerning the relevance of input factors. ANOVA underscores the key role of station streamflow, upstream station streamflow, and maximum temperature in influencing the model’s output. Notably, the RNN model, surpassing LSTM and traditional artificial neural network (ANN) models, excels in accurately mimicking rainfall–runoff processes. This emphasizes the potential of RNN networks to filter redundant information, distinguishing them as valuable tools in monthly streamflow forecasting.