wherein the variables are defined in the specification, or a pharmaceutically-acceptable salt thereof, that are inhibitors of JAK kinases. The invention also provides pharmaceutical compositions comprising such compounds, methods of using such compounds to treat gastrointestinal and other inflammatory diseases, and processes and intermediates useful for preparing such compounds.