The present invention provides pharmaceutically active pyrrolo[2,3-d]pyrimidinyl and pyrrolo[2,3-d]pyridinyl acrylamides and analogues thereof. Such compounds are useful for inhibiting Janus Kinase (JAK). This invention also is directed to compositions comprising methods for making such compounds, and methods for treating and preventing conditions mediated by JAK.