  We discuss whether, and under which conditions, it is possible to realize a
heat engine simply by dynamically modulating the couplings between the quantum
working medium and thermal reservoirs. For that purpose, we consider the
paradigmatic model of a quantum harmonic oscillator, exposed to a minimal
modulation, that is, a monochromatic driving of the coupling to only one of the
thermal baths. We demonstrate, at any order in the system/bath coupling
strength, that in this setup non--Markovianity of the bath is a necessary
condition to obtain a heat engine. In addition, we identify suitable structured
environments for the engine to approach the ideal Carnot efficiency. Our
results open up new possibilities for the use of non--Markovian open quantum
systems for the construction and optimization of quantum thermal machines.
