I'm trying to show that if $X \stackrel{\pi}\to Y \stackrel{\rho}\to Z$ is a sequence of scheme morphisms, there is an exact sequence of quasicoherent $\mathcal{O}_X$ modules $$\pi^*\Omega_{Y/Z} \to \Omega_{X/Z} \to \Omega_{X/Y} \to 0.$$
If $X$, $Y$, and $Z$ are affine, we have the usual cotangent sequence of algebras, and I'd like to construct the exact sequence above from those maps. In the affine case, the map is given by $a \otimes db \mapsto a\;db$ and the second map is $db \mapsto db$. Since $d$ is defined globally, I would expect this second map to behave well on intersections, giving rise to a global map $\Omega_{X/Z} \to \Omega_{X/Y}$ which restricts to the usual affine one. I'm having trouble globalizing the first map, though.
I'm assuming the way to do this is defining a map $\Omega_{Y/Z} \to \pi_*\Omega_{X/Z}$ given by $db \mapsto db$, and then appealing to adjunction to get a map $\pi^* \Omega_{Y/Z} \to \Omega_{X/Z}$, which will be the map we want.
Am I overcomplicating this? Is there an easier way to see these maps glue to give the exact sequence above?
Thank you!
The reason I think I'm missing something is that all introductory books (Vakil, Hartshorne, Gathman, Liu) state this as an obvious consequence of the affine version.
EDIT: I'll add a better attempt. I'm not sure if this works, though, since it seems too easy. We have a base $\{U_i\}$ of open sets of $X$ given by affine subsets $U_i \subseteq X$ so that $U_i \subseteq \pi^{-1}(V_i)$ for $V_i \subseteq Y$ afiine and $V_i \subseteq \rho^{-1}(W_i)$ for $W_i \subseteq Z$ affine. Let's say $U_i = \operatorname{Spec} A_i$, $V_i = \operatorname{Spec} B_i$ and $W_i = \operatorname{Spec} C_i$.
Let $U_i \subseteq U_j$. We have the restriction $\pi^* \Omega_{Y/Z}(U_j) = A_j \otimes \Omega_{B_j/C_j}$ and $\pi^* \Omega_{Y/Z}(U_j) = A_i \otimes \Omega_{B_j/C_j}$ so we can define $A_j \otimes \Omega_{B_j/C_j} \to A_i \otimes \Omega_{B_j/C_j}$ to just be the tensor of the $\mathcal{O}_X$ restriction and the identity on $\Omega_{B_j/C_j}$.
Similarly, we have $\Omega_{X/Z}(U_j) = \Omega_{A_j/B_j}$ and $\Omega_{X/Z}(U_i) = \Omega_{A_i/B_j}$ and the map $\Omega_{A_j/B_j} \to \Omega_{A_i/B_j}$ is given by $a\;d_jb \mapsto a|_{U_i} d_i b|_{U_i}$ where $d_j: A_j \to \Omega_{A_j/B_j}$ is the canonical derivation.
Then, the diagram below commutes. $\require{AMScd}$ \begin{CD} \pi^* \Omega_{Y/Z}(U_j) @>>> \Omega_{X/Z}(U_j)\\ @VVV @VVV\\ \pi^* \Omega_{Y/Z}(U_j) @>>> \Omega_{X/Z}(U_i) \end{CD}
The top path is $$a \otimes db \mapsto a\;d_jb \mapsto a|_{U_i}\;d_i b|_{U_i}$$ and the bottom path is $$a \otimes db \mapsto a|_{U_j} \otimes d_ib \mapsto a|_{U_i}d_ib|_{U_i} $$ which gives commutativity and hence, a morphism on the base. To me, this seems excessively complicated but perhaps this is just the obvious way to do it.