The present invention relates to a pyrrole six-membered heteroaryl ring derivative, the preparation method therefor, and the medicinal uses thereof. Specifically, the present invention relates to a new pyrrole six-membered heteroaryl ring derivative as represented in formula (I), the preparation method therefor, a medicinal composition comprising the derivative, and a therapeutic agent using same, and, in particular, the uses as a JAK inhibitor and an immunosuppressor. Substituents in formula (I) have the same definitions as in description.