Let $k$ be a field, $S$ and $R$ be local $k$-algebras with residue field $k$ and $\phi:S\to R$ be a local homomorphism. Then $\phi$ induces (obviously) a natural transformation of "functors of points" $\phi^*:h_R \to h_S$ (where $h_A(B) = Hom(A, B)$). Let $Art_k$ be the category of local artinian $k$-algebras with residue field $k$ and let $F$, $G$ be the restrictions of $h_R$, resp. $h_S$ to $Art_k$.
There are well-known criteria of (formal) smoothness/etaleness of $\phi$ in terms of the induced transformation $\phi^* : F\to G$. There is also an infinitesimal criterion of flatness, but that is different in spirit.
Question. Is there a criterion on $\phi^*:F\to G$ which ensures that $\phi$ is flat?
You can assume that $\phi$ is finite and that $S$ and $R$ are completions of finitely generated $k$-algebras.