Attack of amine on amide I am confused with the last step of clozapine synthesis:


How can the amine group attack the amide group to form the amidine in such acidic environment? Is the intermolecular reaction between an amine and amide group feasible under not too extreme conditions?
There reaction environment would have to be acidic to protonate the amide, the amide is not natively electrophilic enough to be attacked by the amine. 

A possible point of concern is 'won't the nuclophilic amine be protonated?'  And the answer is absolutely.  But the protonation is a reversible reaction, and at equilbrium with a catalytic amount of acid (almost always TSA is used in catalytic quantities), the proton will be exchanged with various, some of which will lead to the condensation resulting in product.