Advances in neuroimaging have made it possible to reconstruct functional networks from the activity patterns of brain regions distributed across the cerebral cortex. Recent work has shown that flexible reconfiguration of human brain networks over short timescales supports cognitive flexibility and learning. However, modulating network flexibility to enhance learning requires an understanding of an as-yet unknown relationship between flexibility and brain state. Here, we investigate the relationship between network flexibility and affect, leveraging an unprecedented longitudinal data set. We demonstrate that indices associated with positive mood and surprise are both associated with network flexibility – positive mood portends a more flexible brain while increased levels of surprise portend a less flexible brain. In both cases, these relationships are driven predominantly by a subset of brain regions comprising the somatomotor system. Our results simultaneously suggest a network-level mechanism underlying learning deficits in mood disorders as well as a potential target – altering an individual’s mood or task novelty – to improve learning.