Frailty is increasingly present in patients with acute myocardial infarction. The electronic Frailty Index (eFI) is a validated method of identifying vulnerable older patients in the community from routine primary care data. Our aim was to assess the relationship between the eFI and outcomes in older patients hospitalised with acute myocardial infarction. Retrospective cohort study using the DataLoch Heart Disease Registry comprising consecutive patients aged 65years or over hospitalised with a myocardial infarction between October 2013 and March 2021. Patients were classified as fit, mild, moderate, or severely frail based on their eFI score. Cox-regression analysis was used to determine the association between frailty category and all-cause mortality. In 4670 patients (median age 77years [71-84], 43% female), 1865 (40%) were classified as fit, with 1699 (36%), 798 (17%) and 308 (7%) classified as mild, moderate and severely frail, respectively. In total, 1142 patients died within 12months of which 248 (13%) and 147 (48%) were classified as fit and severely frail, respectively. After adjustment, any degree of frailty was associated with an increased risk of all-cause death with the risk greatest in the severely frail (reference = fit, adjusted hazard ratio 2.87 [95% confidence intervals 2.24 to 3.66]). The eFI identified patients at high risk of death following myocardial infarction. Automatic calculation within administrative data is feasible and could provide a low-cost method of identifying vulnerable older patients on hospital presentation.