We show, by means of direct dynamics simulations, how it is possible to define possible reactants and mechanisms leading to the formation of formamide in the interstellar medium. In particular, different ion-molecule reactions in the gas phase were considered: NH 3 OH + , NH 2 OH + 2 , H 2 COH + , and NH 4 + for the ions and NH 2 OH, H 2 CO, and NH 3 for the partner neutrals. These calculations were combined with high level ab initio calculations to investigate possible further evolution of the products observed. In particular, for formamide, we propose that the NH 2 OH + 2 + H 2 CO reaction can produce an isomer, NH 2 OCH + 2 , that, after dissociative recombination, can produce neutral formamide, which was observed in space. The direct dynamics do not pre-impose any reaction pathways and in other reactions, we did not observe the formation of formamide or any possible precursor. On the other hand, we obtained other interesting reactions, like the formation of NH 2 CH + 2 . Finally, some radiative association processes are proposed. All of the results obtained are discussed in light of the species observed in radioastronomy.