We study the drift of slow variables in a slow-fast Hamiltonian system with several fast and slow degrees of freedom. Keeping the slow variables frozen, for any periodic trajectory of the fast subsystem we define an action. For a family of periodic orbits, the action is a scalar function of the slow variables and can be considered as a Hamiltonian function which generates some slow dynamics. These dynamics depend on the family of periodic orbits. Assuming that for the frozen slow variables the fast system has a pair of hyperbolic periodic orbits connected by two transversal heteroclinic trajectories, we prove that for any path composed of a finite sequence of slow trajectories generated by action Hamiltonians, there is a trajectory of the full system whose slow component shadows the path.