The invention provides compounds of formula (I):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 inflammatory bowel diseases, and processes and intermediates useful for preparing such compounds.