  We study the conditions for the onset of Thermal Instability in the innermost
regions of compact galactic nuclei, where the properties of the interstellar
environment are governed by the interplay of quasi-spherical accretion onto a
supermassive black hole (SMBH) and the heating/cooling processes of gas in a
dense nuclear star cluster. Stellar winds are the source of material for
radiatively inefficient (quasi-spherical, non-magnetised) inflow/outflow onto
the central SMBH, where a stagnation point develops within the Bondi type
accretion. We study the local thermal equilibrium to determine the parameter
space which allows cold and hot phases in mutual contact to co-exist. We
include the effects of mechanical heating by stellar winds and radiative
cooling/heating by the ambient field of the dense star cluster. We consider two
examples: the Nuclear Star Cluster (NSC) in the Milky Way central region
(including the gaseous Mini-spiral of Sgr~A*), and the Ultra-Compact Dwarf
galaxy M60-UCD1. We find that the two systems behave in different ways because
they are placed in different areas of parameter space in the instability
diagram: gas temperature vs. dynamical ionization parameter. In the case of
Sgr~A*, stellar heating prevents the spontaneous formation of cold clouds. The
plasma from stellar winds joins the hot X-ray emitting phase and forms an
outflow. In M60-UCD1 our model predicts spontaneous formation of cold clouds in
the inner part of the galaxy. These cold clouds may survive since the cooling
timescale is shorter than the inflow/outflow timescale.
