BackgroundInsomnia in healthcare workers has become a topic of concern in the health system. The high infectivity and longevity of the COVID-19 pandemic have resulted in great pressure and a high incidence of insomnia among healthcare workers. Insomnia among healthcare workers has a negative impact on high-quality healthcare services in addition to their health. Thus, it's necessary to explore insomnia's underlying mechanisms.ObjectThe present research's aims were threefold: explored the association between social support, resilience, COVID-19 anxiety, and insomnia among healthcare workers during the pandemic, elucidated the underlying mechanism of insomnia, and offered recommendations for improving the health of these workers.Materials and methodsA cross-sectional design was adopted. From May 20 to 30, 2022, 1038 healthcare workers were selected to fill out the Oslo 3-item Social Support Scale, the eight-item Athens Insomnia Scale, the Coronavirus Anxiety Scale, and the Brief Resilience Scale. Descriptive statistics and correlations were analyzed by SPSS 25.0. Mediation analysis was conducted by Mplus 8.3 using 5000 bootstrap samples.ResultsOf the participating 1038 healthcare workers, the prevalence of insomnia was 41.62% (432/1038). Significant associations were found involving insomnia, resilience, COVID-19 anxiety, and social support. Insomnia was directly affected by social support. Moreover, three indirect pathways explain how social support affected insomnia: resilience's mediating role, COVID-19 anxiety's mediating role, and the chain-mediation role of resilience and COVID-19 anxiety.ConclusionThe results validated our hypotheses and supported the opinion of Spielman et al. ‘s three-factor model of insomnia. Social support of healthcare workers has an indirect impact on insomnia in addition to its direct one via independent and chain-mediation effects of resilience and COVID-19 anxiety.