Patients with treatment-resistant epilepsy (TRE) frequently exhibit memory and attention deficits that contribute to their poor personal and societal outcomes. We studied the effects of adjunct treatment with pharmaceutical grade cannabidiol (CBD) oral solution (Epidiolex®; Greenwich Biosciences, Inc.) on attention control processes related to stimulus conflict resolution in patients with TRE. Twenty-two patients with TRE underwent 3 T magnetic resonance imaging (MRI) before receiving (PRE) and after achieving a stable dose of CBD (ON). Functional MRI (fMRI) data were collected while patients performed 2 runs of a flanker task (FT). Patients were instructed to indicate via button press the congruent (CON) and incongruent (INC) conditions. We performed t-tests to examine with FT attention control processes at PRE and ON visits and to compare the 2 visits using derived general linear model (GLM) data (INC – CON). We performed generalized psychophysiological interaction (gPPI) analyses to assess changes in condition-based functional connectivity on FT. Median time between fMRI visits was 10 weeks, and median CBD dose at follow-up was 25 mg/kg/d. From PRE to ON, participants experienced improvements in seizure frequency (SF) (p = 0.0009), seizure severity (Chalfont Seizure Severity Scale (CSSS); p < 0.0001), and mood (Total Mood Disturbance (TMD) score from Profile of Mood States (POMS); p = 0.0026). Repeated measures analysis of variance showed nonsignificant improvements in executive function from 34.6 (23.5)% to 41.9 (22.4)% CON accuracy and from 34.2 (25.7)% to 37.6 (24.4)% INC accuracy (p = 0.199). Change in CON accuracy was associated with change in INC accuracy (rS = 0.81, p = 0.0005). Participants exhibited CBD-induced increases in fMRI activation in the right superior frontal gyrus (SFG) and right insula/middle frontal gyrus (MFG) and decrease in activation for both regions at ON relative to PRE (corrected p = 0.05). The subset of patients who improved in FT accuracy with CBD showed a negative association between change in right insula/MFG activation and change in accuracy for the INC condition (rS = − 0.893, p = 0.0068). The gPPI analysis revealed a CBD-induced decrease in condition-based functional connectivity differences for the right SFG seed region (corrected p = 0.05). Whole-brain regression analysis documented a negative association of change in right insula/MFG condition-based connectivity with change in INC accuracy (corrected p = 0.005). Our results suggest that CBD modulates attention control processing in patients with TRE by reducing right SFG and right insula/MFG activation related to stimulus conflict resolution and by dampening differences in condition-based functional connectivity of the right SFG. Our study is the first to provide insight into how CBD affects the neural substrates involved in attention processing and how modulation of the activity and functional connectivity related to attentional control processes in the right insula/MFG may be working to improve cognitive performance in TRE.