A flexible, redox-active macrocycle enables the electrocatalytic reduction of nitrate to ammonia by a cobalt complex† †Electronic supplementary information (ESI) available. CCDC 1823665 and 1823666. For ESI and crystallographic data in CIF or other electronic format see DOI: 10.1039/c8sc00721g