Awaken Warforged (5e Spell)
From D&D Wiki
|V, S, M (Metals and Gems worth at least 1,000 gp, which the spell consumes)
This spell works similarly to awaken, except that the target must be an unanimated Warforged body. If used, the Warforged is created as a Lv. 1 character of the class of your choosing. While charmed, this creature cannot gain experience or levels. Whether this creature remains friendly toward your party depends on how this creature was treated while charmed and subsequent leveling of this character is left to the discretion of your DM.
This spell can be cast on a dead Warforged, up to the DM’s discretion if the body is in good enough condition or not. The reanimated Warforged doesnt regain its previous soul, but instead cause the previous soul to be unable to be revived.