"The Rehearsal Dinner" is the twelfth episode of the ninth season of the CBS sitcom How I Met Your Mother, and the 196th episode overall.
On Saturday at 8pm, 22 and a half hours before the wedding, Barney is handcuffed to a pipe in a security office begging a guard to push a button on a novelty toy. Robin orders the guard not to, furious as the rehearsal dinner started ten minutes earlier and she is now in a laser tag security office waiting for the police to arrive. They then tell the story of how they ended up there.
A few months earlier, Barney hit upon the idea of a rehearsal dinner at a laser tag arena. The gang hates the idea and Robin reminds him that their marriage will be about compromise such as when she agreed to hold the wedding in New York City rather than Canada like she wanted to when they first got engaged. Barney agrees they'll have a normal rehearsal dinner, but it is obvious he isn't going to drop the idea. As a wedding present, Ted tells Robin and Barney that he's willing to take up piano lessons again and play at the dinner, which they refuse until Ted offers to dress like Liberace while doing it. A few days after Robin surprised Barney with his bachelor party, he tearfully declares that the wedding is off and asks her to move out of his apartment. Robin, convinced by Barney's tearful performance, is shocked and ready to pack only to see her suitcase with puppies inside, prompting her to force Barney to stop pulling pranks. Later at the bar, the gang try to convince Barney that Robin has a point, only for Barney to adamantly insist that Robin is trying to pull off a surprise laser tag rehearsal dinner by claiming that the rehearsal dinner at the Farhampton Inn was a fake.
Though the rehearsal dinner is about to begin, Barney continues to insist that Robin is planning the actual dinner as a surprise at a laser tag arena. When Robin reveals the ice dispenser has broken, Barney volunteers to go get more ice, believing that he is playing into Robin's supposed plan. She has him promise not to leave, but Barney immediately leaves anyway and heads straight to the laser tag arena, despite promising Robin he would not.
Meanwhile, Lily is distraught that she is not privy to details about the rehearsal dinner because of her inability to keep secrets. She reminds Ted that she has been able to keep mum about his move to Chicago and points out that he has broken his promise to play piano at the wedding rehearsal dinner dressed as Liberace as his piano lessons had not gone well. Lily tells Ted and Robin about her plan to Italy being in shambles because Marshall took up a judgeship without asking her and that they cannot return to their apartment, as it has already been sublet. Ted is angry with Marshall for his selfishness, but Lily knows that her husband would never intentionally hurt her. Robin must deal with Barney after learning that he went to the laser tag arena and is currently awaiting arrest after threatening one of the staff after realizing there was no surprise rehearsal dinner. As Robin leaves to pick up Barney, Ted comforts Lily by telling her he knows she can keep a secret and offers to tell her one. He whispers it in her ear, and allows her to announce to the guests that there's going to be a change of venue.
Back in the present, Barney is still convinced this is one massive surprise and wants to just head to the laser tag rehearsal dinner despite Robin insisting there isn't one. He insists that marriage isn't just about playing pranks as Robin notices that Barney has freed himself from the handcuffs before he hands her a pair of ice skates. Barney admits that he may lie in the future if it means an amazing surprise; snow begins to fall in the office. When Barney presses the button on the novelty toy, Robin is surprised to see the office's walls suddenly lift up, revealing that the "office" is in the middle of an ice rink surrounded by their family and friends. Barney reveals that because they couldn't have the wedding in Canada, he organized a Canadian-themed rehearsal dinner instead and gives Robin a signed picture of Wayne Gretzky as his wedding gift. The security guard turns out to be a figure skater.
As Alan Thicke and James sing, Lily thanks Ted for letting her in late on the secret; Ted admits that the piano lessons were a cover for taking figure skating lessons, only to fall over almost straight away (Future Ted notes that it takes a lot longer than two months to learn how to figure skate). Robin tells Barney how much she loves him, and promises to get him back for this as Ted limps back over. In the final scene, Barney admits that he loves Canada as he lists several amazing things the country has given the world including Robin and one-quarter of himself. She thanks him and the two skate off as Ted goes by playing the piano as promised.
Bill Kuchman of Popculturology called the episode "impressive," remarking that even with Cristin Milioti missing again, "HIMYM still found a way to reconnect with what makes the show special." Kuchman criticized the decision to keep Marshall separate from the group, noting that he would normally done whatever he needed to make it to such an important event in his friends lives.
The A.V. Club's Donna Bowman graded the episode an A−, admitting that the conclusion of the episode caught her by surprise having expected Robin to have genuinely set up a laser tag rehearsal dinner.
Max Nicholson of IGN gave the episode 7.9/10, saying it delivered a strong rehearsal outing for Barney and Robin.