Increasing agricultural irrigation to counteract a soil moisture deficit has resulted in the production of hazardous agricultural wastewater with high turbidity and chemical oxygen demand (COD). An innovative, sustainable, and effective solution is needed to overcome the pollution and water scarcity issues caused by the agricultural anthropogenic processes. This research focused on a sustainable solution that utilized a waste (broken lentil) as natural coagulant for turbidity and COD removal in agricultural wastewater treatment. The efficiency of the lentil extract (LE), grafted lentil extract (LE-g-DMC) and aluminium sulphate (alum) coagulants was optimized through the response surface methodology. Three-level Box–Behnken design was used to statistically visualize the complex interactions of pH, concentration of coagulants and settling time. LE achieved a significant 99.55% and 79.87% removal of turbidity and COD at pH 4, 88.46 mg/L of LE and 6.9 minutes of settling time, whereas LE-g-DMC achieved 99.83% and 80.32% removal of turbidity and COD at pH 6.7, 63.08 mg/L of LE-g-DMC and 5 minutes of settling time. As compared to alum, LE-g-DMC required approximately 30% less concentration. Moreover, LE and LE-g-DMC also required 75% and 65% less settling time as compared to the alum. Both LE and LE-g-DMC produced flocs with excellent settling ability (5.77 mg/L and 4.48 mL/g) and produced a significant less volume of sludge (10.60 mL/L and 8.23 mL/L) as compared with the alum. The economic analysis and assessments have proven the feasibility of both lentil-based coagulants in agricultural wastewater treatment.