When a diazo compound is formed, and then a nucleophile is added to the mixture. Will nitrogen gas leave first or will the nucleophile have to "do" a substitution reaction? What I mean is will the carbocation be formed due to nitrogen leaving or will it be an SN2 reaction? Or will it depend on the carbon that the diazo group is attached to, (like primary, secondary, etc.) depending on the stability of carbocation formed? In short, I mean to ask if it's SN1 or SN2.
Is it a thumb rule that when an unstable diazo compound is formed, that the nitrogen leaves without any nucleophile intervention?