  The complex dynamics of an increasing number of systems is attributed to the
emergence of a rugged energy landscape with an exponential number of metastable
states. To develop this picture into a predictive dynamical theory I discuss
how to compute the exponentially small probability of a jump from one
metastable state to another. This is expressed as a path integral that can be
evaluated by saddle-point methods in mean-field models, leading to a boundary
value problem. The resulting dynamical equations are solved numerically by
means of a Newton-Krylov algorithm in the paradigmatic spherical $p$-spin glass
model that is invoked in diverse contexts from supercooled liquids to
machine-learning algorithms. I discuss the solutions in the asymptotic regime
of large times and the physical implications on the nature of the
ergodicity-restoring processes.
