Human mobility and activity patterns mediate contagion on many levels, including: spatial spread of infectious diseases, diffusion of rumors, and emergence of consensus. These patterns however are often dominated by specific locations and recurrent flows and poorly modeled by the random diffusive dynamics generally used to study them. Here we develop a theoretical framework to analyze contagion within a network of locations where individuals recall their geographic origins. We find a phase transition between a regime in which the contagion affects a large fraction of the system and one in which only a small fraction is affected. This transition cannot be uncovered by continuous models due to the stochastic features of the contagion process and defines an invasion threshold that depends on mobility parameters, providing guidance for controlling contagion spread by constraining mobility processes. We recover the threshold behavior by analyzing diffusion processes mediated by real human commuting data.