Heavy quarks are produced by hard scattering in relativistic heavy-ion collisions. Since heavy quarks are created early in time, those could be used as effective probes for the lead ions and the QGP. In this parallel talk, new results on beauty and charm meson spectra based on the CMS data collected in Run 2 are presented. Those spectra depend on the nuclear parton distribution functions of the lead ion in the theoretical calculations and could be used to reveal the QGP properties from the early stages of its creation. Moreover, a detailed analysis of fully reconstructed and flavor identified charm mesons could be used to probe the in-medium final-state effects and the strangeness content of the QGP. Finally, the first measurement of D meson pair angular correlation is also presented to provide unprecedented constraints on the heavy quark energy loss mechanism.