An engine for actuating a hydraulic downhole pump having a piston vertically
reciprocated
in a cylinder includes a reversing valve carried with the power piston and serving,
when in a first position, to direct fluid flow to force the piston upwardly and
in a second position to provide bypass fluid flow to cause the piston to move downwardly.
A pilot valve carried by the power piston and serving, when in a lower position,
to direct fluid flow to move the reversing valve from the first to the second position.
A probe is configured to move the pilot valve to the lower position when the piston
reaches an upper limit of travel.