Background & Aims: One of the health-related problems in the workplace is job-related stress. Nursing is one of the professions in which nurses experience a lot of stress. Long-term work stress harms nurses' physical and mental health and reduces their psychological well-being. One of the variables that seem to explain this relationship is cognitive flexibility. Therefore, this study aimed to investigate the relationship between job stress and psychological well-being with the mediating role of cognitive flexibility. Materials & Methods: The present study was a cross-sectional correlational study. The statistical population included all nurses working in hospitals in Isfahan in 2019. Using a cluster sampling method, four hospitals in Isfahan (Kashani, Chamran, Khorshid, and Hojjatieh) were randomly selected. Then four wards were via lottery method selected from each hospital, randomly and 150 questionnaires were distributed among all of the nurses of those wards. The research tool consisted of four questionnaires. 1- Demographic questionnaire 2- HSE Job Stress 3- Short Form of Ryff Psychological Wellbeing Questionnaire 4- Cognitive flexibility. To analyze the data, SPSS software version 16 and the proposed steps of Baron and Kenny were used by the hierarchical regression method. Results: The regression analysis results showed that in the first stage, job stress with beta (β = -0.42) is a significant predictor of psychological well-being. In the second stage, job stress and cognitive flexibility variables predicted psychological well-being with beta (β = -0.21 and β = 0.54), respectively. Since the beta of job stress decreased in the second stage compared to the first stage, the partial mediating role of cognitive flexibility in the relationship between job stress and psychological well-being was confirmed. Conclusion: Most people can cope with stress for a short time, but chronic stress causes changes in physiological and psychological status, the consequences of which can decrease psychological well-being. It seems that some factors play a mediating role in the relationship between job stress and psychological well-being, including cognitive flexibility, which was examined and confirmed in this study. In this regard, it is suggested that sessions be held with the aim of cognitive training flexibility to nurses, and its effectiveness on increasing psychological well-being is examined.