The reliable and timely recognition of outbreaks is a key component of public health surveillance for foodborne diseases. Whole genome sequencing (WGS) offers high resolution typing of foodborne bacterial pathogens and facilitates the accurate detection of outbreaks. This detection relies on grouping WGS data into clusters at an appropriate genetic threshold. However, methods and tools for selecting and adjusting such thresholds according to the required resolution of surveillance and epidemiological context are lacking. Here we present DODGE (Dynamic Outbreak Detection for Genomic Epidemiology), an algorithm to dynamically select and compare these genetic thresholds. DODGE can analyse expanding datasets over time and clusters that are predicted to correspond to outbreaks (or "investigation clusters") can be named with established genomic nomenclature systems to facilitate integrated analysis across jurisdictions. DODGE was tested in two real-world Salmonella genomic surveillance datasets of different duration, 2 months from Australia and 9 years from the United Kingdom. In both cases only a minority of isolates were identified as investigation clusters. Two known outbreaks in the United Kingdom dataset were detected by DODGE and were recognized at an earlier timepoint than the outbreaks were reported. These findings demonstrated the potential of the DODGE approach to improve the effectiveness and timeliness of genomic surveillance for foodborne diseases and the effectiveness of the algorithm developed. DODGE is freely available at https://github.com/LanLab/dodge and can easily be installed using Conda.