Conjugate addition of acrylonitrile (II) to 4-phenylpiperidine (I) affords the piperidinopropionitrile (III). Catalytic hydrogenation of the cyano group of (III) in the presence of Raney nickel and methanolic ammonia leads to diamine (IV). This is further converted into isothiocyanate (VI) by reaction with thiocarbonyl diimidazole (V). Subsequent addition of sodium cyanamide to isothiocyanate (VI) yields the intermediate N-cyano isothiourea sodium salt (VII).
Condensation between 3-nitrobenzaldehyde (VIII) and methyl acetoacetate (IX) in the presence of ammonium acetate under Hantzsch reaction conditions leads to dihydropyridine (X). The nitro group of (X) is then reduced by catalytic hydrogenation to the corresponding aniline (XI). Finally, condensation of aniline (XI) with the cyanoisothiourea (VII) employing HgCl2 furnishes the target N-cyanoguanidine.