The present invention relates to compounds useful as inhibitors of protein kinases. The invention also provides pharmaceutically acceptable compositions comprising the compounds of the invention and methods of using the compositions in the treatment of various disorders. The invention also provides processes for preparing the compounds of the invention.