  The ultrarelativistic jets responsible for prompt and afterglow emission in
gamma ray bursts are presumably driven by a central engine that consists of a
dense accretion disk around a spinning black hole. We consider such engine,
composed of free nucleons, electron-positron pairs, Helium nuclei, and cooled
by neutrino emission. A significant number density of neutrons in the disk
provide conditions for neutron rich plasma in the outflows and jets. Heavy
nuclei are also formed in the accretion flow, at the distances 150-250
gravitational radii from the black hole. We study the process of
nucleosynthesis in the GRB engine, depending on its physical properties. Our
results may have important observational implications for the jet deceleration
process and heavy elements observed in the spectra of GRB afterglows.
