Controlled manipulation of microscale robotic devices in complex fluidic networks is critical for various applications in biomedical endovascular sensing, lab-on-chip biochemical assays, and environmental monitoring. However, achieving controlled transport and active retention of microscale robots with flow sensing capability has proven to be challenging. Here, we report the dynamic tweezing of an anisotropic magnetic microrobot in a rotating magnetic trap for active retention and localized flow sensing under confined fluidic conditions. We reveal a series of unconventional motion modes and the dynamics of the microrobot transporting in a confined fluidic flow, which manifest themselves as transitions from on-trap centre rolling to large-area revolution and off-trap centre rolling with varying rotating frequencies. By retaining the robot within the magnetic trap and its motion modulated by the field frequency, the off-centre rolling of the microrobot endows it with crucial localized flow sensing capabilities, including flow rate and flow direction determination. The magnetic microrobot serves as a mobile platform for measuring the flow profile along a curved channel, mimicking a blood vessel. Our findings unlock a new strategy to determine the local magnetic tweezing force profile and flow conditions in arbitrary flow channels, revealing strong potential for microfluidics, chemical reactors, and in vivo endovascular flow measurement.