The associations between heatwaves and frailty, as well as the joint effects of heatwaves with air pollution and greenery, are currently unknown. This study leverages data from the China Health and Retirement Longitudinal Study (CHARLS), which collected information from 6,400 older adults between 2011 and 2018. Our outcome variable was frailty, as measured by the frailty index (FI > 0.21). Heatwaves were defined based on maximum temperature, incorporating four thresholds (≥ 97.5%, 97.5%, 92.5%, and 90%) and three durations (≥ 2, 3, and 4 days). These variables were considered as time-varying variables, representing the one-year exposure preceding survival events. Fine particulate matter (PM2.5) and greenery (normalized difference vegetation index (NDVI)) were utilized as indicators of air pollution and greenery exposure, respectively, and were treated as time-varying indicators concurrent with heatwaves.Time-varying Cox proportional hazards models were employed to assess the independent effects, as well as the multiplicative and additive interactions of heatwaves, air pollution, and greenery on the risk of frailty. These effects were quantified using hazard ratios (HRs), a traditional product term representing the ratio of HRs, and the relative excess risk due to interaction (RERI). Our findings indicate that heatwaves are associated with an increased risk of frailty, with HRs ranging from 1.035 (95% CI: 1.006–1.064) to 1.063 (95% CI: 1.028–1.101). We observed both a positive multiplicative interaction (HRs > 1) and an additive interaction (RERI > 0) between high level PM2.5 concentration, lack of greenery, and heatwaves. This study reveals that the combined effects exacerbate the adverse impact of heatwaves on the risk of frailty. Moreover, the combined effects of heatwaves, air pollution, and greenery exposure on frailty risk vary across age, gender, and educational attainment.