Automated magnetic control of pumping and compressor pipes