Beckett is invited to her former boyfriend, Will Sorenson's wedding but decides not to go. She's not ready to watch someone else have their perfect day. Castle feels like maybe she would have been happier if they'd never met.
While following the lead on a murder case where an ancient artifact has been stolen, Rick and Kate are attacked. Castle grabs the artifact and is knocked unconscious. When he wakes up he's in an alternate universe where he's never met Beckett, Esposito or Ryan. Martha is a great success. Rick has lost most of his money and never wrote Nikki Heat and Alexis changed her hair color to black and moved to LA to be with her mother.
Castle decides that he must find the artifact to get back to his own timeframe. He convinces Captain Beckett to let him help on the case. She tells him they met once, years ago when she went to one of his book signings. But Castle is disappointed when this Beckett is willing to consider a case closed before justice has been done.
Castle is taken by the person who stole the artifact because they believe he knows how it works. Due to Castle's words, Beckett took the initiative and retraced the steps of the case. She saves him and he finds the artifact but when the tables are turned and shots are fired, Rick takes two bullets to save her life. When he wakes up he's back in his own timeframe with his Kate Beckett.
Castle tells Kate he believes the only way for them to move forward is to do just that. He asks her to marry him right now. They head to the Hamptons with Martha, Alexis, and Jim and get married in a private ceremony on the grounds. Mr. and Mrs Castle share their first dance on the gazebo as In My Veins plays on Rick's cell phone.