Flagella are hair-like projections form the surface of eukaryotic cells and play an important role in many cellular functions such as cell-motility. The beating of flagella is enabled by their internal architecture, the axoneme, and is powered by a dense distribution of motor proteins, dyneins. The dyneins deliver the required mechanical work through the hydrolysis of ATP. Although the dynein ATP-cycle, the axoneme microstructure and the flagellar beating kinematics are well studied, their integration into a coherent picture of ATP-powered flagellar beating is still lacking. Here we show that a timedelayed negative-work based switching mechanism is able to convert the individual sliding action of hundreds of dyneins into a regular overall beating pattern leading to propulsion. We developed a computational model based on a minimal