Automatic identification of debris flow signals in continuous seismic records remains a challenge. To tackle this problem we use a machine learning approach, which can be applied to continuous real-time data streams. We show that a machine learning model based on the random forest algorithm recognizes different stages of debris flow formation and propagation at the Illgraben torrent, Switzerland, with an accuracy exceeding 90%. In contrast to typical debris flow detection requiring instrumentation installed directly in the torrent, our approach provides a significant gain in warning times of tens of minutes to hours. For real-time data streams from 2020, our detector raises alarms for all 8 independently confirmed Illgraben events and gives no false alarms. We suggest that our seismic machine-learning detector is a critical step towards the next generation of debris-flow warning, which increases warning times using both simpler and cheaper instrumentation compared to existing operational systems.