The invention relates to pyrrolopyrazine-spirocyclic piperidine amide compounds useful as inhibitors of ion channels. 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.