The origin of the ultra high energy cosmic rays is still under debate. Although observational data indicate that the arrival direction of UHECRs is coincident
with starburst galaxies and Active Galactic Nuclei (AGN), the former do not have enough power to accelerate particles up to ultra high energies. On the other hand, recent theoretical advances indicate that backflows in the termination region of AGN jets can accelerate particles up to the Hillas limit. In addition, the interaction of stars with the AGN jet can serve as an effective mechanism for the jet mass loading; needed to explain the heavy composition of UHECRs as indicated by Pierre Auger data.
In the present contribution we review these results and present our future perspectives.