The Mannich reaction allows placing the aminomethyl group on position 2 of the pyrrole.

mannich-pyrrol-01

Mechanism:

Stage 1. Formation of the Mannich electrophile

mannich-pyrrol-02

Stage 2. Nucleophilic attack of pyrrole on the Mannich electrophile

mannich-pyrrol-03

Stage 3. Recovery of aromaticity

mannich-pyrrol-04

Stage 4. Neutralization

mannich-pyrrol-05