Background Cheonwangbosim-dan (CBD) is a traditional Korean herb formula that has been widely prescribed for insomnia patients with a heart-yin deficiency (HYD) pattern. Several studies have recently reported that heart function and insomnia are interrelated, and others have explored associations between insomnia, oral microbiota, and tongue diagnosis. This study aimed to evaluate the effects of CBD on primary insomnia, tongue diagnosis, and oral microbiota. We conducted a prospective, open-label clinical trial on primary insomnia. At baseline, 56 patients with primary insomnia were assigned to two groups, a HYD group and a non-HYD (NHYD) group. Members of these groups took CBD for 6 weeks. Primary and secondary outcomes including Pittsburgh Sleep Quality Indices (PSQIs), Insomnia Severity Indices (ISIs), actigraphy results, cardiac function, autonomic nerve function, clinical laboratory results, tongue features, and oral microbiota were collected from all subjects at after 0, 3, or 6 weeks of treatment. Additionally, PSQI and ISI were determined by telephone follow-up 10 weeks after study commencement.Results During the study, PSQIs and ISIs decreased significantly in both groups. However, the PSQI reduction observed in the HYD group was greater than in the NHYD group and sleep times as determined by actigraphy, that is, total bedtimes (TBTs) and total sleep times (TST), increased only in the HYD group. As sleep quality improved, the amount of tongue coating increased at the posterior tongue, where heart function appears. At baseline, the HYD and NHYD group had a specific oral microbiota (Veillonella at genus level), but no significant change was observed after taking CBD. Additionally, subjects were divided into two oral microbiota types (‘orotype’). The genera Prevotella, Veillonella or Neisseria were abundant in each orotype. The reduction in PSQI in the orotype 1 during the 6-week treatment period was greater than in orotype 2.Conclusions Taking together, CBD was effective in primary insomnia patients with a HYD pattern and CBD increased the amount of tongue coating. In addition, oral microbiota distributions were different in patients with a HYD or a NHYD pattern. The study shows CBD could be used to treat primary insomnia in patients with a HYD pattern as determined using tongue diagnosis and oral microbiota distributional patterns.