Isoniazid (I) was treated with carbon disulfide and KOH to give potassium 4-pyridyl dithiocarbazinate (II). Cyclization of (II) in the presence of hydrazine produced the amino triazole (III). This was condensed with 5-bromoisatin (IV), yielding the imino adduct (V). Finally, Mannich reaction of (V) with piperidine (VI) and formaldehyde furnished the title compound.