Aims. We consider the gamma-ray burst (GRB) central engine that is powered by the collapse of a massive rotating star or compact binary merger. The engine is a hot and dense accretion disk, which is composed of free nucleons, electron-positron pairs, and helium, and cooled by neutrino emission. A significant number density of neutrons in the inner disk body provide conditions for neutron rich plasma in the GRB outflows or jets. helium is synthesized in the inner disk if the accretion rate is large, and heavy nuclei are also formed in the outer disk at distances above 150−250r g from the black hole. We study the process of nucleosynthesis in the GRB engine, depending on its physical properties. Methods. The GRB central engine is hydrodynamically modelled in the frame of a dense and hot disk, which accretes with a high rate (up to 1 Solar mass per second) onto a maximally spinning, stellar mass black hole. The synthesis of heavy nuclei up to germanium and gallium is then followed by the nuclear reaction network. Results. The accretion at high rate onto a Kerr black hole feeds the engine activity and establishes conditions for efficient synthesis of heavy nuclei in the disk. These processes may have important observational implications for the jet deceleration process and heavy elements observed in the spectra of GRB afterglows.