  In this paper, we study modular forms on two simply connected groups of type
$D_4$ over ${\mathbb Q}$. One group, $G_s$ is a globally split group of type
$D_4$, viewed as the group of isotopies of the split rational octonions. The
other, $G_c$, is the isotopy group of the rational (non-split) octonions. We
study automorphic forms on $G_s$, in analogy to the work of Gross, Gan, and
Savin on $G_2$; namely we study automorphic forms whose component at infinity
corresponds to a quaternionic discrete series representation. We study
automorphic forms on $G_c$ using Gross's formalism of ``algebraic modular
forms''. Finally, we follow work of Gan, Savin, Gross, Rallis, and others, to
study an exceptional theta correspondence connecting modular forms on $G_c$ and
$G_s$. This can be thought of as an octonionic generalization of the
Jacquet-Langlands correspondence.
