This study aims to ascertain the influence of peer attachment and self-regulated learning on the academic flow of students at Muhammadiyah senior high schools in Yogyakarta, Indonesia. This study employed a quantitative research methodology. The study sample consisted of 255 twelfth-grade students of the Muhammadiyah High Schools, selected using the stratified random sampling technique. For the measurement, three psychological scales were employed, including the academic flow scale, the peer attachment scale, and the self-regulated learning (SRL) scale. The data were analyzed using multiple linear regression, with the assistance of the SPSS for Windows 23.0 program. The results of the primary hypothesis yielded an R-squared value of 0.603 with a p-value of 0.000 (p < 0.01), indicating that peer attachment and self-regulated learning exert a significant influence on academic flow. The first minor hypothesis test yielded a t-value of 2.189, with a p-value of 0.030, which is less than 0.05. The second minor hypothesis test yielded a t-value of 9.779 and a p-value of 0.000, indicating a statistically significant result (p < 0.01). The statistical results demonstrate that peer attachment and self-regulated learning have a significant impact on academic flow, with each factor exerting a positive influence. The results demonstrate that self-regulated learning makes a significant contribution to academic flow, accounting for 32.67% of the variance. Similarly, peer attachment is found to have a notable impact on academic flow, explaining 3.70% of the variation.