I'm studying the deformation theory of compact complex manifolds as developed by Kodaira and Spencer. On the side I'm reading as much about deformation theory in general as I can get my hands on (and understand), and I've been wondering about the relationship between the basic definitions in the analytic and algebraic categories. To summarize:

*Analytic side*: A complex analytic family of smooth compact manifolds is a holomorphic map $\pi : \mathcal X \to S$ of smooth complex manifolds $\mathcal X$ and $S$ such that $\pi$ is a proper submersion and each fiber $X_t = \pi^{-1}(t)$ is a compact complex manifold. This implies some other conditions, like that $\mathcal X$ is locally trivial over $S$.

*Algebraic side*: A family of schemes is a proper flat morphism $\pi : X \to Y$ of schemes.

I've been asking myself what the relationship between these definitions is. To get something like the algebraic definition in the analytic category we just replace "scheme" by "complex space".

Now, a complex manifold is a smooth complex space, and ~~local triviality of $\mathcal X$ along with compactness of the fibers implies that $\pi : \mathcal X \to S$ is proper~~ (edit: unnecessary). I'm also fairly certain that $\pi$ is flat (my algebraic side is weak), so $\pi : \mathcal X \to S$ will be a family of complex spaces in the algebraic sense.

My question is: what conditions do we need on $\pi : X \to Y$ to pass in the other direction? Is it enough that the complex spaces $X$ and $Y$ be smooth? I've been thinking about this and I've got this vague idea that flatness of $\pi$ and coherence of the structure sheaves will lead to local triviality, but I haven't been able figure out how.