Nitriles are recurring motifs in bioactive molecules and versatile functional groups in synthetic chemistry. Despite recent progress, direct introduction of a nitrile moiety in heteroarenes remains challenging. Recent developments in electrochemical reactions pave the way to more practical cyanation protocols. However, currently available methods typically require hazardous cyanide sources, expensive mediators, and often suffer from narrow substrate scope and laborious reaction set-up. To address the limitations of current synthetic methods, herein, an effective, sustainable, and scalable procedure for the direct C(sp 2 )À H cyanation of aromatic N-heterocycles with a userfriendly flow-electrochemical set-up is reported. Furthermore, high substrate and functional-group tolerance is demonstrated, allowing late-stage functionalization of drug-like scaffolds, such as natural products and pharmaceuticals.