To develop machine learning (ML) and deep learning (DL) models to predict glaucoma surgical outcomes, including postoperative intraocular pressure, use of ocular antihypertensive medications, and need for repeat surgery. We identified glaucoma surgeries performed at Stanford from 2013-2024, with two or more postoperative visits with intraocular pressure (IOP) measurement. Patient features were identified from the electronic health record (EHR), including demographics, prior diagnosis and procedure codes, medications and eye exam findings. Classical ML and DL models were developed to predict which glaucoma surgeries would result in surgical failure, defined as (1) IOP not reduced by more than 20% of preoperative baseline on two consecutive postoperative visits, (2) increased classes of glaucoma medications, and (3) need for additional glaucoma surgery or revision of original surgery. A total of 2398 glaucoma surgeries of 1571 patients were included, of which 1677 surgeries met failure criteria. Random forest performed best for prediction of overall surgical failure, with accuracy of 75.5% and area under the receiver operator curve (AUROC) of 76.7%, similar to the deep learning model (accuracy 75.5%, AUROC 76.6%). Across all models, prediction performance was better for IOP outcomes (AUROC 86%) than need for an additional surgery (AUROC 76%) or need for additional glaucoma medication (AUC 70%). ML and DL algorithms can predict glaucoma surgery outcomes using structured data inputs from EHRs. Models that predict outcomes of glaucoma surgery may one day provide the basis for clinical decision support tools supporting surgeons in personalizing glaucoma treatment plans.