The present invention relates to compounds of formula (I), which are inhibitors of protein kinases. The invention also provides pharmaceutical compositions comprising the compounds of the invention and methods of using the compositions in the treatment of various disorders.