Continuity equation states that the mass/volume flow through a pipe remains constant at all times.

Not quite.
Chemical engineers like the following version
Input = Output + Accumulation.
So the mass or volume discharge rate is constant so long as there is no accumulation somewhere in the system.
Loss such as a leak is obviously negative accumulation.
Having settled that, let's look at your question.
So you have a pipe feeding a tap which you adjust.
The way to apply the continuity equation is to assume there is no loss or accumulation so the discharge after the tap must be equal to the discharge before the tap which must be equal to the quantity of fluid entering the pipe.
What changes is the velocity as well as the cross section.
So the volumetric discharge is Area Cross Section x Velocity = a Constant
If the area changes at the tap or the pipe gets smaller the velocity increases.