It is one of the most important synthesis of indole. Part of phenylhydrazine and a carbonyl with alpha hydrogens, which generate a hydrazone. After a tautomerism, a sigmatrope is produced that yields the indole after cyclization.
The hydrazone formation step has a well-known mechanism (the same one that forms imines) and we are not going to comment on it. We will focus on the steps that convert hydrazone to indole.
Stage 1. Tautomerism.
Stage 2. Sigmatropic [3,3]
Stage 3. Rearomatization
Stage 4. Cyclization
Stage 5. Acid base balance
Stage 6. Elimination of ammonia.
Step 7. Rearomatization of the pyrrole ring