Although the heart has its own nervous system, its organization and functionality remain largely unknown. Here, the authors reveal the molecular, chemical, and functional diversity of neurons within the intracardiac nervous system and their role in controlling the heart’s rhythm in the zebrafish.