On-surface synthesis is a promising strategy for engineering heteroatomic covalent nanoarchitectures with prospects in electronics, optoelectronics and photovoltaics. Here we report the thermal tunability of reaction pathways of a molecular precursor in order to select intramolecular versus intermolecular reactions, yielding monomeric or polymeric phthalocyanine derivatives, respectively. Deposition of tetra-aza-porphyrin species bearing ethyl termini on Au(111) held at room temperature results in a close-packed assembly. Upon annealing from room temperature to 275 °C, the molecular precursors undergo a series of covalent reactions via their ethyl termini, giving rise to phthalocyanine tapes. However, deposition of the tetra-aza-porphyrin derivatives on Au(111) held at 300 °C results in the formation and self-assembly of monomeric phthalocyanines. A systematic scanning tunnelling microscopy study of reaction intermediates, combined with density functional calculations, suggests a [2+2] cycloaddition as responsible for the initial linkage between molecular precursors, whereas the monomeric reaction is rationalized as an electrocyclic ring closure.