A heat engine can be defined as a device or a machine that converts the heat supplied by a source into useful mechanical work.
Thus from the definition of the heat engine, for a machine to be a heat engine, it should convert the heat supplied to it into mechanical work.
Thus for a machine to be a heat engine, it must perform the conversion of heat into mechanical work.