The present invention relates to novel pyrroloazacyclic derivatives of formula (I), their preparation methods and the pharmaceutical compositions containing the same, and their use as a therapeutic agent in particular as a protein kinase inhibitor, wherein each substituent in formula (I) is defined as in the description.本發明係關於一種通式(I)所示之新穎吡咯并氮雜環類衍生物或其鹽、其製備方法及含有它們的醫藥組成物和它們作為治療劑,特別為作為蛋白激酶抑制劑的用途,其中,通式(I)中的各取代基與說明書中的定義相同。