Beckett informs Castle that he only has less than a day to live. He asks about an antidote but she tells him that it was stolen with the poison. Beckett promises that they will find whoever took that antidote and that Castle can't get out of their engagement that easily. Castle tells her that before Jack died he mentioned Dreamworld which is a secret military base in the Middle East.
Rachel talks with Beckett about the case. Whoever is behind this must have had contact with Jack and they are looking into his steps leading up to his death. Beckett asks if Rachel has ever heard of Dreamworld.
The doctor injects Castle with something to slow down his impending death. It only gives him an hour or so though. The doctor tells him he has 10-12 hours left to live unless Beckett can reach the antidote in time.
Chief Carl Villante is skeptical about the ghost military base, and Rachel believes it was just the ramblings of a dying man. Agent Richmond interrupts them and says he thinks it does exist. He found mention of it where a journalist wanted to write an article named "Inside Dreamworld" but the government stopped him. Castle shows up and suggests checking Jack's phone records. Carl allows Castle to help but he is Beckett's responsibility and he can't leave the building.
Rachel and Beckett leave to meet with the journalist, Parker. He doesn't want to give up his sources but reconsiders when Beckett tells him that Jack was murdered. Parker started poking around about Dreamworld and found out it was a covert ops base. He spoke with Jack, who worked there, but didn't receive much information. Whatever he did at the base Jack didn't want the information getting out. Beckett asks about Valkyrie but Parker has never heard of it. The Secretary of Defense was the one who shut the story down and Parker says he is behind it. The two women head to meet Defense Secretary Reed, the former commander of Dreamworld.
When they meet with Reed, he says that Dreamworld is a myth. Rachel asks why he shut down the article about the special ops base, and Beckett asks what Jack's connection to the base was. Reed warns them that everything he is about to say is strictly off the books. Jack only worked one mission out of the base. He was the man on the ground that reported when a man entered the house. Beckett asks about Valkyrie but Reed doesn't know it. That operation took out a big chunk of al-Qaeda and there was talk of retaliation but it never happened. Beckett suspects that it may be happening now.
Castle asks how al-Qaeda knows about Jack if it is a retaliation attack. Beckett says he may have been seen by locals or family members of those killed in the operation. Castle reassures Beckett that he is okay. He receives a call from his mother and daughter and asks where he has been. Castle doesn't tell his mother that he is dying. He tells Alexis that hopefully he will be back tomorrow morning and tells her he loves her.
The team finds some family members of the al-Qaeda leader who was killed. They find video of one of the family members following Jack around. Richmond finds a live feed of the man walking down the street and Beckett heads out. She finds the man and tackles him to the ground after he tries to run away. However, the toxin and antidote aren't on him.
The man, Rasheed, is in interrogation with Rachel and Beckett. Rasheed claims that he's innocenct, but they have photo evidence of him following Jack three hours before he died. Rasheed says they have it wrong, Jack was following him. He wanted to know if Rasheed had talked to anyone about their secret. Rasheed was the first one on the scene and saw Jack carrying a body of a servant girl. Jack said that if Rasheed ever told anyone what he had seen he would kill him.
Castle worries that he is doomed because now they have no leads. They have mission details surrounding the night of the bombing. It is very redacted but Castle suggests they search for Valkyrie by looking at blacked-out words of the same length. Richmond suggests that he may be able to access flight recordings and hear the audio from the mission.
Martha visits Javier and Kevin at the station because she can't get in touch with Castle or Beckett. She wants to know what is wrong with Castle.
Castle asks Rachel how Beckett is working out on the force. Rachel says she is doing great and Castle feels good knowing she will be all right when he is gone. Richmond calls them over to listen to the audio. After listening to it they realize that Reed killed an American operative and Jack retrieved the body. Carl asks if they are suggesting that Reed had Jack killed to cover up the murder. Carl knows what is at stake for Beckett and Castle but he can't let her go after Reed without any evidence.
Beckett shows up at Reed's house and asks why he lied about Valkyrie. He denies having any involvement and warns her not to start a war she can't finish.
Back at their headquarters, Carl is at first upset that Beckett confronted Reed at his house. He is then impressed when he realizes that she forced him to show his hand. He filed a complaint against her, and he wouldn't have done that if he was trying not to draw attention to himself.
Rachel examines a photo of the terrorist's family and sees the American operative disguised as the servant girl. The army claimed that she died from an IED. The body was retrieved by Brad Parker, the reporter who wrote about Dreamworld. Carl suggests that Parker was the one who stole the toxin and is out for revenge. The team heads to Parker's apartment hoping to find the antidote. Castle is allowed to come along because it is unknown how much time he has. In the apartment they find blueprints and think that Parker is planning on killing Reed next. He is set to speak at the naval academy tonight.
On the way to Reed, Beckett and Castle discuss what Parker's plans may be. If Parker is out for revenge he may want to take away Reed's loved one, just like what happened to him. Beckett turns the car around and heads for Reed's house, where his wife is. Castle doesn't have much time left so they need to hurry.
At the Reed household, Parker meets with Julie Reed. When Beckett arrives soon after, Castle passes out when he exits the car. Beckett enters alone and finds Mrs. Reed on the ground and Parker runs away. Beckett asks for the antidote before it's too late. Parker wrestles the gun from her grip and says it's too late for Castle and everyone else.
Castle wakes up in a hospital bed surrounded by his family. He says sometimes the hardest things in life are the ones most worth doing. He jokes that next time he's dying to see her they should keep it metaphorical.
Beckett asks about Mrs. Reed and Rachel says she will pull through. Beckett asks if Reed will be investigated but Rachel says he probably won't. Rachel backed Beckett up without even knowing what she was doing and Rachel says that's what partners do. Beckett whispers this back to herself and stares towards Castle's hospital room door.