Risk factors analysis and prediction models of atrial fibrillation/flutter after esophagectomy Authors: Minghao Ji, Xinlong Pang, Xiangyan Liu, Bin Jiang Published: 2026 ABSTRACT AbstractBackgroundPostoperative atrial fibrillation/flutter (POAF) increases postoperative complications and hospitalization time. Identifying those at risk of atrial fibrillation/flutter after major thoracic surgery allows prophylactic therapy to be targeted toward those most likely to benefit.ObjectiveA clinical prediction model for POAF in cancer patients undergoing esophagectomy was developed and validated to identify the incidence and clinical correlates of POAF.Methods623 patients undergone radical esophagectomy for cancer were included. The POAF prediction models were constructed using a backward selection strategy by starting with factors with p ≤ 0.1 in univariable analyses. Influence factors with a multivariate P < 0.05 were defined as statistically significant. The discrimination of the models was determined by calculating the AUC of the ROC curve. Goodness-of-fit of the model was evaluated by Hosmer–Lemeshow test. Calibrating, nomogram and randomForest algorithm were also applied to develop the prediction model.ResultsThe end point of the study, POAF, occurred in 25.5% of patients (159/623) at a median of 2 days. In univariable analyses, the differential factors associated with atrial fibrillation/flutter including age (median, 67 vs. 64 years; p < 0.0001), male (94% vs. 88%; p = 0.022), hypertension (42% vs. 31%; p = 0.019), FEV1/FVC (median, 74.89 vs. 77.06%; p = 0.010), premature atrial contraction (PAC, 42% vs. 15%; p < 0.0001), left atrial dilation (15% vs. 5%; p = 0.0002), preoperative neutrophilic granulocyte percentage (GRA, median, 65.8 vs. 63.7%; p = 0.013). The AUC of this model is 0.725. Postoperative viables were also included in another model, which prediction efficiency is better than the former. (AUC = 0.736)ConclusionWe developed two predictive models identified preoperative and postoperative risk factors and targeted preventive therapy would be administered in selected patients.Keywords: POAF, Esophagectomy, Prediction model, Risk factors, Validation Introduction Esophageal carcinoma is one of the most common diseases worldwide, the preferred treatment for it is esophagectomy. Benefit from the standardization of surgical techniques, tremendous advance has been made toward decreasing postoperative complications, such as anastomotic leakage, chylothorax [1]. However, atrial fibrillation has remained one of the most frequent complications that occur after noncardiac thoracic surgery, including esophagectomy [2, 3]. Postoperative atrial fibrillation/flutter (POAF) is a familiar arrhythmia after esophagectomy (10–46%) [4–11]. The pathophysiologic mechanism of AF after esophagectomy still remains incompletely uncleared, but may represent a combination of the effects of altered sympathovagal balance, intraoperative trauma to autonomic fibers, and oxidative and inflammatory changes contributing to an enhanced susceptibility to reentrant arrhythmias after surgery [12]. POAF is associated with increased risk of postoperative complications, in addition to higher mortality [4, 13]. Meanwhile, POAF is also related to subsequent stroke after noncardiac and cardiac surgery [14]. Therefore, identification of patients at high risk will help to develop more individualized and cost-effective treatment plans so that surgeons can use targeted prophylactic drugs. The purpose of this research is to identify risk factors associated with the new onset of atrial fibrillation/flutter after esophagectomy and to establish prediction models to allow more targeted interventions in patients with the highest risk [3]. Materials and methods After approval by institutional review board and waiver of informed consent, we retrospectively incorporated into 702 consecutive patients who confirmed esophageal carcinoma and received surgical treatment at department of thoracic surgery of The Second Affiliated Hospital of Zhejiang University from January 2016 to August 2022. 32 patients were excluded due to undergo non-radical surgery. Other exclusion criteria included rhythm other than sinus (at the time of preoperative evaluation, we included patients with a history of AF but in sinus rhythm), died on the day of surgery, received pacemaker implantation, current use of antiarrhythmic drugs, lack relevant clinical data. Finally, total 623 patients (557 male and 66 female patients; median age, 65 years) were included in the final study. Inclusion and exclusion criteria are summarized in the flow diagram (Fig. 1). Flow diagram of study introducing the inclusion and exclusion criteria Preoperative evaluations including but not limited to medical history, detailed physical examination, 12-lead electrocardiogram or Holter monitor, conventional transthoracic echocardiographic (TTE) analysis, spirometric test and blood routine examination within three months. 12-lead electrocardiogram diagnose atrial premature beats or Holter monitor observed more than 46 atrial extrasystoles within 24 h was defined as premature atrial contraction (PAC). Right bundle branch block (RBBB) was also diagnosed by ECG. Besides, all patients were examined by transthoracic echocardiography before operation. The internal diameter of left atrium in apical four-chamber plane was additional measured for patients with abnormal enlargement of left atrium. The product of long diameter(cm) and short diameter > 23.57 was defined as left atrial dilation. The operation was performed by thoracotomy or minimally invasive esophagectomy (MIE), meanwhile, operation duration and intraoperative bleeding were recorded. Postoperative management methods included airway management, pain management, nutritional support and electrolyte balance, et al. Multimodal analgesia is routinely practiced at our institution, including regional nerve blocks (paravertebral block), patient-controlled analgesia (PCA), and systemic analgesic agents (NSAIDs and opioids as needed). The analgesia protocol was standardized across the cohort. Patients who had undergone esophagectomy were monitored with continuous electrocardiogram monitoring for at least 72 h, or longer if needed. Patients did not receive routine antiarrhythmic therapy after resection. Blood tests were performed on all patients at 5 am on the first day after operation (postoperative day 1, POD1) including blood routine examination, hepatorenal function. The study end point was the atrial fibrillation/flutter lasting more than five minutes detected by continuous electrocardiogram monitoring or bedside electrocardiogram if the patient has typical symptoms of AF (such as irregular pulse or palpitation) after telemetry was discontinued. What needs to be emphasized is that there is a spontaneous transition between typical atrial flutter and atrial fibrillation [15, 16], simultaneously, the treatment of atrial fibrillation and atrial flutter is about the same. Therefore, we included the patients with postoperative atrial flutter into this study. Finally, the demographic data as described above were analyzed by SPSS statistical software version 25 (IBM® SPSS). A binary logistic regression algorithm was used to quantify the relationships between clinical characteristics and POAF. The POAF prediction models were constructed using the stepwise backward likelihood ratio (backward LR) selection strategy by including factors with p ≤ 0.1 in univariable analyses. Influence factors with a multivariate p < 0.05 were defined as statistically significant. The discrimination of the models was assessed by calculating the area under curve (AUC) of the receiver operating characteristic (ROC) curve. Goodness-of-fit of the models was evaluated by Hosmer–Lemeshow test. In order to visualize the prediction results of the model, we drew a nomogram based on the rms package (version 6.3.0). The ‘nomogram’ function was used with default parameters. This function draws a partial nomogram that can be used to manually obtain predicted values from a regression model that was fitted with rms. Hence, we got nomograms with the model built before. A calibration plot and C-index were used to evaluate the prediction model’s performance. The C-index is the proportion of pairs in all patient pairs whose predicted results are consistent with the actual results. It estimates the probability that the predicted outcome will agree with the actual observed outcome. Calibration plots used the ‘calibrate’ function with method = ‘boot’, which uses bootstrapping to get bias-corrected (overfitting- corrected) estimates of predicted vs. observed values based on subsetting predictions on nonparametric smoothers. An ideal predicting model would produce a graph in which the observed and predicted probabilities are exactly the same and aligned along a 45-degree line. Since the imbalance of our dataset affected the prediction results of the model, we need to adopt methods to correct this problem. Considering that oversampling has the problems of overfitting and poor generalization; Undersampling will lose a lot of collected real-world data, which reduces the accuracy of the model, thus synthetic data based on DWmR (version 2.0.3) was used. We used the ‘SMOTE’ function with perc.over = 250, perc.under = 150, final positive and negative data both had 477 clinic cases, thus ensuring the balance of the dataset and the accuracy of our final model. To ensure the importance of the included clinical factors to the overall prediction results, in addition to the analysis results using SPSS, we also analyzed data based on the randomForest package (version 4.7.1.1) [17]. The ‘randomForest’ function with mtry = 29, ntree = 8000 was adopted to sort the importance of variables. This function implements Breiman’s random forest algorithm (based on Breiman and Cutler’s original Fortran code) for classification and regression. It can also be used in unsupervised mode for assessing proximities among data points. As a result, it gave MeanDecreaseAccuracy and MeanDecreaseGini for all factors, which represent the influence of variables on the accuracy of the final model and the Gini index respectively. We referred to the ranking results given by this function to analyze the factors that were more closely related to the prediction result, and combined the analysis results of SPSS to finally decided which variables to be considered. Patient and Public Involvement statement: It was not appropriate or possible to involve patients or the public in the design, or conduct, or reporting, or dissemination plans of our research. Results Total 623 patients clinical data in the cohort are presented in Table 1; Fig. 2A. The end point of the study, POAF, occurred in 25.5% of patients (159/623) at a median of 2 days (Fig. 3). In univariable analyses, the differential factors associated with atrial fibrillation/flutter including age (median, 67 vs. 64 years; p < 0.0001), male (94% vs. 88%; p = 0.022), hypertension (42% vs. 31%; p = 0.019), FEV1/FVC (median, 74.89 vs. 77.06%; p = 0.010), PAC (42% vs. 15%; p < 0.0001), left atrial dilation (15% vs. 5%; p = 0.0002), preoperative GRA (median, 65.8 vs. 63.7%; p = 0.013). The multivariable logistic regression formula for predicting POAF is showed in Table 2. The ROC curve was generated following multivariable logistic regression analysis. Its AUC was 0.725 (0.677–0.772, 95% CI). (Fig. 4A) The Hosmer-Lemeshow goodness-of-fit statistic result was p = 0.373. Table 1Clinical characteristics of patients and univariable logistic regression results for POAFCharacteristicPOAF(n = 159; 25.5%)Non-POAF(n = 464; 74.5%)Univariable logistic regression OR (95% CI)p valueAge67 (63–72)64 (58–69)1.069 (1.042–1.098)< 0.0001Male150 (94)407 (88)2.334 (1.128–4.832)0.022History of smoking96 (60)278 (60)1.020 (0.706–1.473)0.918History of drinking92 (58)270 (58)0.987 (0.685–1.421)0.942Hypertension66 (42)145 (31)1.561 (1.077–2.264)0.019Coronary heart disease32 (20)86 (19)1.107 (0.704–1.742)0.659Diabetes mellitus10 (6)27 (6)1.086 (0.514–2.297)0.829Neoadjuvant therapy32 (20)101 (22)0.906 (0.580–1.415)0.663Neoadjuvant immunotherapy23 (15)71 (15)0.936 (0.563–1.557)0.799Preoperative β-blocker use8 (5)15 (3)1.586 (0.659–3.814)0.303Preoperative calcium blocker use39 (25)93 (20)1.297 (0.846–1.987)0.233BMI22.04 (19.95–23.88)21.97 (19.94–24.11)0.999 (0.941–1.061)0.980FEV1(measured value/predicted value)95.29 ± 16.8698.17 ± 17.390.990 (0.980–1.001)0.070FEV1/FVC74.89 (66.88–79.71)77.06 (71.46–81.53)0.975 (0.956–0.994)0.010DLCOcSB6.46 (5.29–7.69)6.78 (5.56–7.86)0.933 (0.839–1.037)0.201DLCOcSB(measured value/predicted value)81.76 ± 15.8383.44 ± 18.550.995 (0.985–1.005)0.308PAC66 (42)68 (15)4.133 (2.751–6.209)< 0.0001RBBB2 (1)23 (5)0.244 (0.057–1.048)0.058Left atrial dilation23 (15)23 (5)3.243 (1.763–5.962)0.0002Preoperative heart rate, bpm69 (62–75)68 (61–75)1.012 (0.996–1.028)0.156Preoperative WBC5.9 (4.9–7.1)6.2 (5.2–7.6)0.943 (0.857–1.037)0.225Preoperative RBC4.28 (3.94–4.60)4.27 (3.85–4.60)1.123 (0.810–1.557)0.488Preoperative GRA65.8 (59.4–71.6)63.7 (57.2–69.8)1.025 (1.005–1.045)0.013Categorical variables are presented as No. (%), continuous variables are presented as Median (Q1–Q3) (abnormal distribution) or Mean ± SD (normal distribution) Clinical characteristics of patients and univariable logistic regression results for POAF Categorical variables are presented as No. (%), continuous variables are presented as Median (Q1–Q3) (abnormal distribution) or Mean ± SD (normal distribution) The forest plot that visualizes the OR value and its confidence interval. A: POAF model. B: the model of POAF attacked after the day of surgery. On the right side of the vertical line are the risk factors for POAF, vice versa Number of patients who developed POAF at each postoperative day. The most common new onset of POAF was observed on the second postoperative day (72 cases, 45%) Table 2Multivariable logistic regression model for the probability of POAFVariableMultivariable logistic regressionOR (95% CI)p valueAge1.049 (1.019–1.080)0.001Male2.410 (1.106–5.256)0.027PAC3.571 (2.297–5.552)< 0.0001RBBB0.168 (0.038–0.752)0.020Left atrial dilation2.734 (1.415–5.281)0.003Preoperative GRA1.022 (1.000-1.043)0.045 Multivariable logistic regression model for the probability of POAF Receiver operating characteristic (ROC) curve, generated from the model using predictors following multivariable logistic regression analysis. A: POAF model. B: the model of POAF attacked after the day of surgery In order to explore the relationship between postoperative status and the incidence of POAF, we collected the blood test results of the patients in the early hours of the first day after operation, for predicting POAF attacked after the day of surgery. In addition to 7 variables mentioned above, we also found that postoperative GRA (median, 89.6 vs. 89.1%; p = 0.022), BUN (median, 6.58 vs. 5.72 mmol/L; p < 0.0001) and Cr (median, 68.0 vs. 66.1µmol/L; p = 0.014) were associated with POAF. (Table 3; Fig. 2B) As before, the AUC of the multivariable logistic regression for predicting POAF attacked after the day of surgery was 0.736 (0.690–0.783, 95% CI). (Fig. 4B; Table 4) The Hosmer-Lemeshow goodness-of-fit statistic result was p = 0.528. Table 3Clinical characteristics of patients and univariable logistic regression results for POAF attacked after the day of surgeryCharacteristicPOAF attacked after the day of surgery(n = 151; 24.2%)Non-POAF(n = 472; 75.8%)Univariable Logistic RegressionOR (95% CI)p valueAge67 (63–72)64 (58–69)1.066 (1.038–1.095)< 0.0001Male142 (94)415 (88)2.167 (1.046–4.490)0.037History of smoking92 (61)282 (60)1.051 (0.722–1.529)0.796History of drinking86 (57)276 (59)0.940 (0.649–1.361)0.742Hypertension62 (41)149 (32)1.510 (1.035–2.204)0.033Coronary heart disease29 (20)89 (19)1.023 (0.642–1.630)0.924Diabetes mellitus9 (6)28 (6)1.005 (0.463–2.180)0.990Neoadjuvant therapy30 (20)103 (22)0.888 (0.563–1.401)0.610Neoadjuvant immunotherapy22 (15)72 (15)0.947 (0.565–1.589)0.838Preoperative β-blocker use8 (5)15 (3)1.704 (0.708–4.103)0.234Preoperative calcium blocker use37 (25)95 (20)1.288 (0.835–1.987)0.253BMI22.04 (19.94-24.00)21.97 (19.95–24.08)1.001 (0.942–1.064)0.971FEV1(measured value/predicted value)95.72 ± 16.9997.99 ± 17.370.992 (0.982–1.003)0.161FEV1/FVC74.89 (67.26–79.84)77.02 (71.37–81.47)0.976 (0.957–0.995)0.015DLCOcSB6.45 (5.29–7.75)6.79 (5.56–7.83)0.934 (0.838–1.040)0.212DLCOcSB(measured value/predicted value)81.78 ± 16.0283.41 ± 18.450.995 (0.985–1.005)0.331PAC63 (42)71 (15)4.043 (2.683–6.094)< 0.0001RBBB2 (1)23 (5)0.262 (0.061–1.125)0.072Left atrial dilation23 (15)23 (5)3.508 (1.905–6.459)< 0.0001Preoperative heart rate, bpm69 (62–75)68 (61–75)1.011 (0.995–1.028)0.184Preoperative WBC6.0 (5.0-7.1)6.2 (5.2–7.6)0.948 (0.861–1.045)0.282Preoperative RBC4.28 (3.94–4.61)4.27 (3.85–4.59)1.127 (0.808–1.572)0.481Preoperative GRA65.8 (59.4–71.8)63.7 (57.3–69.8)1.027 (1.006–1.047)0.010Operation time310 (265–370)305 (260–355)1.000 (0.998–1.003)0.709Intraoperative blood transfusion5 (3)31 (7)0.487 (0.186–1.276)0.143Postoperative WBC12.9 (10.6–16.8)12.2 (9.7–15.5)1.038 (0.999–1.079)0.058Postoperative Hb129.47 ± 16.41127.74 ± 16.981.006 (0.995–1.017)0.271Postoperative GRA89.6 (87.5–91.9)89.1 (86.6–91.3)1.062 (1.009–1.119)0.022Postoperative K+4.0 (3.7–4.3)3.9 (3.7–4.2)1.381 (0.917–2.080)0.122Postoperative Na+134 (132–137)134 (132–137)0.988 (0.940–1.039)0.643Postoperative BUN6.58 (5.27–8.16)5.72 (4.60–6.84)1.290 (1.171–1.421)< 0.0001Postoperative Cr68.0 (59.0–83.0)66.1 (56.0-78.9)1.011 (1.002–1.019)0.014 Clinical characteristics of patients and univariable logistic regression results for POAF attacked after the day of surgery Table 4Multivariable logistic regression model for the probability of POAF attacked after the day of surgeryVariableMultivariable logistic regressionOR (95% CI)p valueAge1.037 (1.006–1.069)0.020Male2.390 (1.089–5.247)0.030PAC3.086 (1.960–4.859)< 0.0001RBBB0.176 (0.038–0.810)0.026Left atrial dilation2.932 (1.508–5.702)0.002Postoperative GRA1.066 (1.009–1.127)0.024Postoperative BUN1.166 (1.045-1.300)0.006 Multivariable logistic regression model for the probability of POAF attacked after the day of surgery In regard to operation procedures, the incidence of POAF has no statistical difference between minimally invasive esophagectomy and open thoracotomy (p = 0.182). Furthermore, reconstruction organ (p = 1.000), anastomotic position (p = 0.299), nutrition tube placement(p = 0.450), none of these factors is related to POAF. (Table 5) Table 5Effect of operation procedures on POAFVariablePOAF(n = 159; 25.5%)Non-POAF(n = 464; 74.5%)Totalp valueThoracic approach0.182#Thoracotomy34 (21.4%)124 (26.7%)158 (25.4)Thoracoscopy125 (78.6%)340 (73.3%)465 (74.6)Reconstruction organ1.000*Stomach158 (99.4%)460 (99.1%)618 (99.2%)Colon1 (0.6%)4 (0.9%)5 (0.8%)Anastomotic position0.299*cervix44 (27.7%)154 (33.2%)198 (31.8%)thorax115 (72.3%)308 (66.4%)423 (67.9%)abdomen0 (0.0%)2 (0.4%)2 (0.3%)Nutrition tube placement0.450#Non nutrition tube5 (3.1%)20 (4.3%)25 (4.0%)Jejunostomy tube127 (79.9%)348 (75.0%)475 (76.2%)Nasointestinal tube27 (17.0%)96 (20.7%)123 (19.7%)Operative duration316.78 min317.01 min0.975Estimated blood loss95.66 ml113.63 ml0.304# p value was calculated by Chi-square test and * p value was analysed by Fischer exact test Effect of operation procedures on POAF # p value was calculated by Chi-square test and * p value was analysed by Fischer exact test Prediction model and validation The 9 variables (age, male, hypertension, FEV1 measured value/predicted value, FEV1/FVC, PAC, RBBB, left atrial dilation, preoperative GRA) with p ≤ 0.1 in univariable analyses were considered as candidates for multivariable logistic regression analysis to predict POAF. The final multivariable model included age, male, PAC, RBBB, left atrial dilation, preoperative GRA (Table 2). in another univariable analyses, 12 variables (age, male, hypertension, FEV1/FVC, PAC, RBBB, left atrial dilation, preoperative GRA, postoperative WBC, postoperative GRA, postoperative BUN, postoperative Cr) with p ≤ 0.1 were included in the regression analysis to predict POAF attacked after the day of surgery. The final multivariable analysis included age, male, PAC, RBBB, left atrial dilation, postoperative GRA and postoperative BUN (Table 4). According to these prediction models, we generated two nomograms for predicting the probability of POAF and POAF attacked after the day of surgery (Fig. 5). The nomograms visualize the prediction results of the models. (A) was used to assess the probability of POAF of preoperative patients and postoperative assessment applied (B). To sum up the points identified on the scale for each of the variables to obtain the total points. The total points corresponding to the risk axial scale is the probability of POAF Internal validation was performed by bootstrap approach. Calibration curves show excellent consistency between the observed and predicted probabilities. (Fig. 6) The bias-corrected C-index and original C-index are 0.715 and 0.725 in the POAF model, respectively. Meanwhile, the bias-corrected and original C-index are 0.724 and 0.736, respectively, in the model of POAF attacked after the day of surgery. These results reflected good discrimination. Calibration curves for the probability of POAF from the prediction models A: POAF model. B: the model of POAF attacked after the day of surgery Discussion Postoperative atrial fibrillation/flutter is a common arrhythmia after esophagectomy (10–46%). The exact pathophysiologic mechanism of AF after esophagectomy is a complicated, multifactorial process, its still remains incompletely understood. Myocardial reperfusion injury, inflammation, atrial fibrosis, and dysfunction of autonomic nerve fibers were reported to be the proposed pathophysiologic changes underlying heightened POAF risk [18]. Hence, we retrospectively analyzed risk factors for new-onset atrial fibrillation/flutter following esophagectomy in an attempt to guide prophylactic use of anti-arrhythmic strategies. Analysis for clinical characteristics POAF occurred in 25.5% of patients undergoing esophagectomy in our study, within a reasonable range. Until now, age is the only recognized predictor of POAF [19, 20]. Our findings also perfectly confirm this conclusion (p < 0.0001). Aging causes degenerative changes in atrial anatomy that are accompanied by related changes in atrial physiology such as shorter effective refractoriness, longer SA and AV nodal conduction times, atrial stiffening, and splitting of the atrial excitation waveform caused by the pectinated trabeculae [20–22]. It is possible that unavoidable trauma to sympathovagal fibers originating from the deep or superficial cardiac plexus during surgery may be contributing to preexisting atrial electrical changes caused by aging, predisposing to AF [20]. In addition to age, POAF occurs more frequently after esophagectomy in male patients(p = 0.022), correspond with Ma et al. [23]. This gender difference hasn’t been explained definitively, may be related to sex hormone levels, electrophysiological properties et al. Hypertension predisposes to cardiac structural changes, which influence the development of AF, such as atrial remodeling [18]. Previous literatures have been substantiated that hypertension is associated with increased risk of developing AF [24–26]. We demonstrated that history of hypertension does increase the incidence of POAF. Consistent with Nojiri et al. [27], we also found a correlation between forced expiratory volume in 1 s/percent forced vital capacity and POAF, although patients who developed POAF had a lower FEV1/FVC value than those who did not (p = 0.010), the values were too small to predict POAF on the final multivariate analysis. By the way, POAF wasn’t associated with worse pulmonary diffusion function. (p = 0.308) Premature atrial contraction (PAC) is an emerging risk marker that can help identify patients in sinus rhythm who are likely to have, or develop, paroxysmal AF. Similarly, increasing frequency or duration of nonsustained runs of atrial tachyarrhythmia have been associated with AF [28]. Our findings support the argument that PAC was a strong independent predictor of POAF(p < 0.0001). Previous studies have shown that preoperative echocardiographic indexes of atrial dysfunction are associated with the risk of POAF after thoracic surgery, including early trans-mitral velocity/tissue Doppler mitral annular early diastolic velocity (E/Ea), left atrial diameter (LAD) and E wave/e′ wave ratio (E/e′) [9, 27]. Here, we demonstrated that the larger LAD, the higher the incidence of POAF (p = 0.0002). Left atrial dilation caused organic change (remodeling) of heart and therefor directly triggered of atrial fibrillation/flutter of surgical stress response. Apart from the above mentioned, inflammatory response also plays a very important role in POAF. Yang et al. [29] observed a significant correlation between the postoperative peripheral blood neutrophil count and the incidence of POAF. The same phenomenon was verified in pericardial fluid [30]. We found both preoperative and postoperative neutrophil percentage after esophagectomy were associated with the development of atrial fibrillation/flutter (p = 0.013 and 0.022). Amar et al. [31] previously reported that there is a prominent relationship between an increase in white blood cells(WBC) count on postoperative day 1 (POD1) and patients who develop AF after esophagectomy. We have taken postoperative WBC on POD1 into the multivariate analysis, nonetheless, it was not included in the final forecasting model. This phenomenon may be due to an adrenergic phenomenon rather than systemic inflammatory response. [31] We report here for the first time that postoperative blood urea nitrogen (BUN) and creatinine (Cr) are positively correlated with the probability of POAF (p < 0.0001 and p = 0.014), although Cr was rejected by final prediction model. BUN is one of the common indicators of renal function, BUN level increased during impaired renal failure, hypovolemia and surgical stress. In the surgical patient, blood and/or fluid loss decrease venous return to right atrium, loss of fluids and hemorrhage can lead to reflex sympathetic hyperactivity, which may increase the secretion of catecholamines and eventually, lead to atrial fibrillation [32]. This may explain, at least partly, our finding that postoperative BUN is associated to POAF. Furthermore, according to previous researches, the use of β-blockers and calcium-channel blockers has resulted in different effect on occurrence rate of POAF in selected patients [33, 34], however, our results do not support these conclusions. Ojima, T et al. found that POAF was significantly associated with use of colonic reconstruction after esophagectomy [35], inconsistent with our result. This may be due to the low number of colon reconstructions we taken into consideration. Whether minimally invasive operation affects the incidence of POAF has been controversial for a long time. Pu et al. [18] and Chen et al. [5] considered minimally invasive esophagectomy may reduce the incidence of POAF, however, he incidence of POAF was similar whether MIE or open thoracotomy in our cohort, consistent with Day et al.’s study [36]. By the way, neoadjuvant therapy [7, 19, 36](including neoadjuvant immunotherapy), BMI [33], alcohol consumption [37], intraoperative blood loss [4] are included as risk factors of POAF, whereas, our results don’t support these conclusions. Predictive ability of the model In the first model (Table 2), we have taken into 6 variables from medical history and preoperative examination. It shows good combined diagnostic ability (AUC = 0.725). In order to investigate whether postoperative examination indicators can improve the predictive ability of POAF, we built the second model by including several additional postoperative variables (Table 4). This model’s diagnostic performance on POAF attacked after the day of surgery is better than the former (AUC = 0.736). Internal validation of the second model was performed by bootstrap approach and the bias-corrected and original C-index are 0.724 and 0.736, respectively. All of these indicate the good discriminative ability of the model. Perspective Identification of risk factors of AF would allow for more targeted intervention in selected patients, while also reducing the exposure of those at a lower risk for POAF to potential drug-related toxicity and costs [12]. According to relevant literature reports, postoperative prophylactic diltiazem or intravenous amiodarone may be considered to prevent POAF in patients undergoing esophagectomy [38–40]. In consideration of amiodarone tend to cause hypotension, atrioventricular block and liver damage or dysfunction, Ojima et al. [41] initiated a randomized, double-blind, placebo-controlled trial enrolled patients scheduled for transthoracic esophagectomy. They demonstrated that landiolol, an ultra-short-acting high selective β1-blocker, was effective and safe in preventing atrial fibrillation after esophagectomy. The guidelines of the American Association for Thoracic Surgery also suggested that some prophylactic drugs can reduce the occurrence of POAF [38]. Prophylactic drugs might be targeted use for the patients with high risk of POAF who are evaluated preoperatively or postoperatively by our models. Using the first model, surgeon can select high-risk patients and use prophylactic drugs before operation. Furthermore, the second model will help surgeon identify patients who are missed preoperatively but at high risk postoperatively and this model has better predictive ability. In a word, our dual-model give more choice to clinicians, what needs to be pointed out is that the type and dosage of the prophylactic drug remains to be explored. Finally, we drew a mode pattern/graphical abstract to summarize the results described in the text (Fig. 7). Graphical abstract Limitations It should be pointed out that our conclusions do not apply to asymptomatic (occult) AF patients and we did not record information on the occurrence of POAF after discharge. Due to the lack of relevant clinical data in retrospective studies, we didn’t explore the association between E/Ea [27], E/e’ [9], left atrial diastolic volume index [42], brain natriuretic peptide [33] and POAF, while these influence factors may improve the accuracy of the prediction model. Our prediction models were derived from single center and race, external validation in multicenter study and more diverse cohorts are still necessary to determine whether they can be generalized to a universal population. Meanwhile, the prediction models require testing in a randomized and multicenter prospective trial with a larger sample size. At the same time, we also need to design prospective trials based on the models to explore the application of preventive medicine for POAF. Conclusion We developed two predictive models identified preoperative and postoperative risk factors and targeted preventive therapy would be administered in selected patients. Online calculator Since the dataset imbalance affects the prediction results of the model, we introduced an oversampling method to make up for it (methods for details). We constructed an online dynamic calculator to estimate the risk of POAF based on the modified nomograms (Fig. 8). The operation interface of the online dynamic calculator to estimate the risk of POAF A: POAF model. B: the model of POAF attacked after the day of surgery Preoperative prediction model URL: https://junglingfish.shinyapps.io/DynNomapp_pre/. Postoperative prediction model URL: https://junglingfish.shinyapps.io/DynNomapp_pod/. In order to evaluate the importance of the included clinical factors to the overall prediction results, we also analyzed data based on the randomForest algorithm (Fig. 9). The importance of the included clinical factors to the overall prediction results, calculated by randomForest algorithm. A: POAF model. B: the model of POAF attacked after the day of surgery Acknowledgements Not applicable. Abbreviations Postoperative atrial fibrillation/flutter Premature atrial contraction Right bundle branch block Transthoracic echocardiography Minimally invasive esophagectomy Postoperative day Forced expiratory volume in 1 s Forced vital capacity Blood urea nitrogen Creatinine Receiver operating characteristic Area under curve Body mass index Diffusion Lung capacity for Carbon Monoxide Neutrophilic granulocyte percentage White blood cell Red blood cell Hemoglobin Author contributions Bin Jiang contributed to the study conception, design and review. Data collection was performed by Minghao Ji, data analysis was performed by Xinlong Pang. Material preparation was performed by Xiangyan Liu. Minghao Ji was a major contributor in writing the manuscript. All authors reviewed and approved the final manuscript. Minghao Ji and Xinlong Pang contributed equally to this manuscript. Funding This research received no external funding. Data availability The datasets used and/or analysed during the current study are available from the corresponding author on reasonable request. Declarations Ethics approval and consent to participate The study was conducted according to the guidelines of the Declaration of Helsinki and was approved by the Ethics Committee of Second Affiliated Hospital of Zhejiang University (NO.2022 − 0886). Informed consent Patient consent was waived due to the approval from the ethics committee. Competing interests The authors declare no competing interests. Footnotes Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations. Minghao Ji and Xinlong Pang contributed equally to this manuscript. References Associated Data Data Availability Statement The datasets used and/or analysed during the current study are available from the corresponding author on reasonable request.