  We introduce a general formalism to analyze nucleation phenomena in
inhomogeneous media which considers the influence of the metastable phase,
which is treated as a heat bath in which clusters are embedded, in the dynamics
of the nucleation process. A kinetic equation for the evolution of the
probability density of the clusters, taking into account possible
inhomogeneities in the bath, is derived using mesoscopic nonequilibrium
thermodynamics. From it, we obtain the nucleation rate and analyze the role
played by the metastable phase in the process. We discuss in particular
condensation and polymer crystallization in a temperature gradient.
