Adverse outcomes after elective cancer surgery are a main contributor to decreased survival, poorer oncological outcomes and increased healthcare costs. Identifying high-risk patients and selecting interventions according to individual risk profiles in the perioperative period in cancer surgery is a challenge. Using real-world data on 18,403 patients with colorectal cancer from Danish national registries and consecutive patients from a single center, we developed, validated and implemented an artificial-intelligence-based risk prediction model in clinical practice as a decision support tool for personalized perioperative treatment. Personalized treatment pathways were designed according to the predicted risk of 1-year mortality with the intensity of interventions increasing with the predicted risk. The developed model had an area under the receiver operating characteristic curve of 0.79 in the validation set. Results from the nonrandomized before/after cohort study showed an incidence proportion of the comprehensive complication index >20 of 19.1% in the personalized treatment group versus 28.0% in the standard-of-care group, adjusted odds ratio of 0.63 (95% confidence interval, 0.42-0.92; P = 0.02). The incidence of any medical complication was 23.7% in the personalized treatment group and 37.3% in the standard-of-care group; odds ratio of 0.53 (95% confidence interval, 0.36-0.76; P < 0.001). According to the short-term health economic modeling, personalized perioperative treatment was cost effective. The study demonstrates a fully scalable registry-based approach for using readily available data in an artificial-intelligence-based decision support pipeline in clinical practice. Our results indicate that this specific approach can be a cost-effective strategy to improve key surgical clinical outcomes.