We study a $T^2$ deformation of large $N$ conformal field theories, a higher dimensional generalization of the $Tbar T$ deformation. The deformed partition function satisfies a flow equation of the diffusion type. We solve this equation by finding its diffusion kernel, which is given by the Euclidean gravitational path integral in $d+1$ dimensions between two boundaries with Dirichlet boundary conditions for the metric. This is natural given the connection between the flow equation and the Wheeler-DeWitt equation, on which we offer a new perspective by giving a gauge-invariant relation between the deformed partition function and the radial WDW wave function. An interesting output of the flow equation is the gravitational path integral measure which is consistent with a constrained phase space quantization. Finally, we comment on the relation between the radial wave function and the Hartle-Hawking wave functions dual to states in the CFT, and propose a way of obtaining the volume of the maximal slice from the $T^2$ deformation.