Bart's class is creating a time capsule and everyone brings something to put in it. Bart has forgotten, so he blows his nose on a sandwich and throws it in.
During an electrical storm, Marge hears a noise and Homer and Bart go to investigate. Homer sets a trap using Bart as bait in the basement and the noise turns out to be Bender from Futurama.
Homer and Bender become fast friends when Homer takes him to Moes and then bowling with Lenny and Carl.
Lisa is not convinced that Bender is from the future, so she takes him to see Professor Frink. After he unplugs Bender and then plugs him back in, Bender reveals he came to the past to kill Homer. However, now that they are friends, Bender can't go through with it.
Bender projects Leela, Fry, and Professor Farnsworth who explain that there are creatures with Homer's DNA destroying New New York. They sent Bender back to kill Homer to prevent this from happening. It turns out that wouldn't have helped though, because the creatures were actually created by Bart's DNA on the sandwich in the time capsule.
The group goes to the school with the intention of digging up the time capsule, but are sucked back into the future before they can. Only Bender and Maggie are left in the present.
In the future, Lisa lures the Bart creatures to Madison Cube Garden where the Professor is then able to shoot them all out into space, saving New New York. The Simpson family returns to their time and ask Bender how he will return to the future. He sets his alarm for one thousand years and goes to sleep.