Let us assume first of all that we are in the affine case (we can worry about globalization later) and that we have $X$ affine over $S$, where $S$ is some unspecified scheme (but in practice probably the spectrum of a field), with $X=\mathrm{Spec}(A)$ (thus $A$ is an $\mathcal{O}_S$-algebra). We are emphatically *not* assuming $X$ to be smooth over $S$.

Assume that we are given a map $\mathfrak{g}\to\mathrm{Der}_S(A)$ of Lie algebras and that we are viewing $\mathfrak{g}$ as a Lie-sub-algebra of $\mathrm{Der}_S(A)$.

In analogy with the differential-geometric case we can interpret this as a distribution on $X$ and so we can ask: what are the integral subschemes of this distribution? Specifically, is there, through every point, a *unique* integral subscheme? And even more importantly, what can go wrong in the singular points and can we "integrate" this action to an analogue of a Lie groupoid?

I'm seriously betting the answer to most of the above is a resounding "NO!" but I'm curious to know *what* can go wrong and what is *known* to go wrong? In short: what is known concerning this? Can one form something like "$X/\mathfrak{g}$"?

Finally, let me iterate that I'm not assuming $X$ to be $S$-smooth.