Described herein is the sequential 1,3-N- to C- and 1,3-C- to C-migration of sulfonyl groups through the synthesis of 1,4-diazepines from an operationally simple thermal aza-[5 + 2] cycloaddition reaction of indoloazomethine ylides with dialkyl acetylenedicarboxylates under mild conditions, leading to the formation of C-sulfonylated 1,4-diazepines.