To analyze cognitive performance and brain activation during a working memory task in patients with migraine during various phases of the migraine cycle and compare to healthy participants. Cognitive difficulties reported during migraine attacks remain poorly understood, despite evidence that the lateral frontoparietal network undergoes reversible disturbances and decreased activation during attacks. Recent findings in resting state functional magnetic resonance imaging suggest that brain areas involved in this network interact with subcortical regions during spontaneous migraine attacks. In this prospective, within-subject study, 10 patients with diagnosed menstrual-related episodic migraine without aura underwent 3T functional magnetic resonance imaging assessments while performing a working memory task across four phases of the natural migraine cycle: peri-ictal (preictal, ictal, postictal) phases and interictally (between attacks). Migraine prophylaxis was an exclusion criterion. Fourteen healthy controls were assessed during the corresponding phases of their menstrual cycles. The protocol was completed by 24 female participants aged 21 to 47 years: 10 with migraine (four sessions each) and 14 healthy controls (two sessions each) yielding a total of 68 analyzed datasets. Patients and controls showed similar performance on the working memory task and displayed increased brain activity in regions linked to this function, namely the middle frontal gyrus, inferior parietal lobe, and anterior cingulate cortex, during all phases of the migraine/menstrual cycle. Patients with migraine (N = 10) exhibited a significant decrease in hypothalamic activity (p = 0.007) as measured by the percent signal change (PSC) during the postictal phase compared to perimenstrual controls (N = 14), with -2 (16) and 31 (35) PSC, respectively. Comparing across the migraine cycle, the change in hypothalamic activity relative to controls in the postictal phase -0.33 (0.2) ΔPSC was significantly different from the ones in the interictal (0.006 [0.5] ΔPSC; p = 0.002) and preictal (-0.08 [0.4] ΔPSC; p = 0.034) phases. During a working memory task, cognition-related brain activation was present across all phases of the migraine cycle similarly to healthy control participants. Patients with migraine, however, displayed lower neural activity at the subcortical level in the postictal phase. Nonetheless, the sample size is a limitation for the generalization of our results. More research is needed to fully understand how the brain copes with cognitive demands during spontaneous migraine attacks.