This evening I was watching Coppelia, a ballet where a toymaker tries to bring a doll he made to life. Coppelia premiered in 1870 and the story of Pinocchio was written in 1870. This shows up even earlier, in 1823, in Frankenstein, where Victor Frankenstein creates a corpse and brings it to live, and recently in Star Trek (where, in Requiem for Methuselah, Flint creates Rayna and attempts to make her "real" by giving her emotions), and in Star Trek: The Next Generation, where Data is even called Pinocchio, both on screen and in the series bible.
Where did this trope start? Is there evidence of stories of making a creation that seems almost like a lifelike human and trying to bring it to life from even before Frankenstein?