A 1D Josephson junction loop, doped with a spin-flipper and attached to two thermal reservoirs is shown to operate as a heat engine, or a refrigerator, or a Joule pump or even as a cold pump. When operating as a quantum heat engine, the efficiency of this device exceeds that of some recent Josephson heat engine proposals. Further, as a quantum refrigerator, the coefficient of performance of this device is much higher than previously proposed Josephson junction based refrigerators. In addition, this device can be tuned from engine mode to refrigerator mode or to any other mode, i.e., Joule pump or cold pump by either tuning the temperature of reservoirs, or via the flux enclosed in the Josephson junction loop. This makes the proposed device much more versatile towards possible applications.