Protoplanetary disks are known to possess a variety of substructures in the distribution of their millimetre-sized grains, predominantly seen as rings and gaps1, which are frequently interpreted as arising from the shepherding of large grains by either hidden, still-forming planets within the disk2 or (magneto-)hydrodynamic instabilities3. The velocity structure of the gas offers a unique probe of both the underlying mechanisms driving the evolution of the disk—such as movement of planet-building material from volatile-rich regions to the chemically inert midplane—and the details of the required removal of angular momentum. Here we report radial profiles of the three velocity components of gas in the upper layers of the disk of the young star HD 163296, as traced by emission from 12CO molecules. These velocities reveal substantial flows from the surface of the disk towards its midplane at the radial locations of gaps that have been argued to be opened by embedded planets4,5,6,7: these flows bear a striking resemblance to meridional flows, long predicted to occur during the early stages of planet formation8,9,10,11,12. In addition, a persistent radial outflow is seen at the outer edge of the disk that is potentially the base of a wind associated with previously detected extended emission12.