Plants adapt to fluctuating environmental conditions by adjusting their metabolism and gene expression to maintain fitness. In legumes, nitrogen homeostasis is maintained by balancing nitrogen acquired from soil resources with nitrogen fixation by symbiotic bacteria in root nodules. I will outline our forward- and reverse-genetics approaches to identify novel regulators of nitrogen fixation in legumes. Unexpectedly, we found that zinc, an essential plant micronutrient, acts as an intracellular second messenger connecting environmental changes to transcription factor control of metabolic activity in root nodules. We identify a novel transcriptional regulator, FIXATION UNDER NITRATE (FUN), that acts as a sensor, with zinc controlling the transition between an inactive filamentous megastructure and an active master regulator. Lower zinc concentrations in the nodule, which we show occur in response to higher levels of soil nitrate, dissociates the filament and activates FUN. FUN then directly triggers breakdown of the nodule. The zinc-dependent filamentation mechanism thus establishes a concentration readout to adapt nodule function to the environmental nitrogen conditions. Our genetic and biochemical analysis identifies an unexpected regulatory mechanism and opens new possibilities for translation to the field.