We study theoretically ferrofluid pipe flow in a wide range of the flow rate in the presence of an oscillating magnetic field applied along the pipe axis. As demonstrated, the field-dependent part of ferrofluid viscosity (it can be either positive or negative) reveals significant dependence on the flow vorticity, i.e., ferrofluids exhibit non-Newtonian behavior. This is manifested in an alteration of the velocity profile - it ceases to be parabolic - and in deviation of the flow rate from the value prescribed by the Poiseuille's formula. The presented theoretical model is based on the conventional ferrohydrodynamic equations, an assumption of chainlike aggregates composed of magnetic grains, and some concepts of polymer physics. The model allows to describe self-consistently how the microstructure influences the ferrofluid flow in an externally imposed magnetic field while the field and the flow alter the ferrofluid microstructure. Using the model, we succeeded fitting well recent experimental data on the ferrofluid pipe flow in an oscillating magnetic field.