Foodborne bacterial infections pose serious threats to human health, leading to illnesses and even fatalities. The key to solve this problem is to develop fast and effective sensor for sensitive detection of bacteria. In this study, an electrochemical biosensor based on magnetic nanocomposite material Fe3O4@COF-AuNPs and trigging isothermal circular amplification (TICA) was constructed for detection of foodborne bacteria. In this design, a hairpin aptamer probe (HAP)-bound DNA monolayer was designed, serving as the substrate for the electrode to increase surface area. The Escherichia coli (E. coli) was selected as the target. The presence of E. coli caused the configuration change of the HAP and allowed the occurrence of TICA with the use of the Klenow Fragment polymerase (KF-Poly), thus the HAPs were away from the DNA monolayer. After adding the catalytic magnetic nanocomposite material Fe3O4@COF-AuNPs, it was immobilized on the DNA monolayer of the electrode through DNA complementary pairing and exhibited high electrocatalytic behavior towards the reduction of 4-nitrophenol. This enabled ultrasensitive detection of E. coli, with the detection limit (LOD) as low as 10 CFU/mL. The detection time was 1 h. This designed electrochemical sensor showed high selectivity, stability, and reproducibility, which offered a new avenue for detection of foodborne bacteria.