Monitoring flow-based systems (FBS) (e.g., water distribution systems, oil and gas pipelines, the human cardiovascular system) is of paramount importance considering their economic and health impacts. FBS monitoring typically has been achieved by costly, complex, static sensors that are strategically placed. To reduce the cost of monitoring, we propose a mobile wireless sensor network (WSN) system comprised of mobile sensors (their movement aided by the inherent flow in the FBS) and static beacons that aid in locating sensors. This article presents the first complete architectural design, algorithms, and protocols for optimal monitoring of FBS. Our proposed solution includes sensing and communication models, MAC and group management protocols for sensor and beacon communication, and algorithms for sensor and beacon placement. We compare our proposed solution with the state of the art through extensive simulations and a proof-of-concept system implementation. We demonstrate performance improvements, such as a dramatic reduction (a factor of 91) in the number of sensors when the sensing range is marginally (2.5 times) increased.