The invention relates to prodrugs of JNK inhibitors and corresponding methods, formulations, and compositions for inhibiting JNK and treating JNK-mediated disorders. The application discloses prodrugs of JNK inhibitors, as described below in formula I: wherein m, n, p, q, Q, r, R1, R2, R3, X, X1, X2, X3, X4, X5, Y1, Y2, Z1 and Z2 are as defined herein. The compounds and compositions disclosed herein are useful to modulate the activity of JNK and treat diseases associated with JNK activity. Disclosed are methods and formulations for inhibiting JNK and treating JNK-mediated disorders, and the like, with the compounds, and processes for making said compounds, and corresponding compositions, disclosed herein.