We compute 3D gasdynamical models of jet outflows from the central AGN, that carry mass as well as energy to the hot gas in galaxy clusters and groups. These flows have many attractive attributes for solving the cooling flow problem: why the hot gas temperature and density profiles resemble cooling flows but show no spectral evidence of cooling to low temperatures. Subrelativistic jets, described by a few parameters, are assumed to be activated when gas flows toward or cools near a central SMBH. Using approximate models for a rich cluster (A1795), a poor cluster (2A 0336+096) and a group (NGC 5044), we show that mass-carrying jets with intermediate mechanical efficiencies ($sim10^{-3}$) can reduce for many Gyr the global cooling rate to or below the low values implied by X-spectra, while maintaining $T$ and $rho$ profiles similar to those observed, at least in clusters. Groups are much more sensitive to AGN heating and present extreme time variability in both profiles. Finally, the intermittency of the feedback generates multiple generations of X-ray cavities similar to those observed in Perseus cluster and elsewhere. Thus we also study the formation of buoyant bubbles and weak shocks in the ICM, along with the injection of metals by SNIa and stellar winds.