Kids, did I ever tell you about the time when “How I Met Your Mother” creators Carter Bays and Craig Thomas signed a rich overall pact with 20th Century Fox TV?

This is the story of how Bays and Thomas met their three-year, eight figure megadeal — and suited up to join the ranks of TV’s sitcom titans.

Not only does the new pact keep the exec producers on “Mother” through a potential season eight, but it also starts the ball rolling on new development from the duo.

First up, Bays and Thomas are on board to exec produce a sitcom from “Mother” scribes Kourtney Kang and Joe Kelly.

The spec script, which was sent to the networks over the weekend, revolves around a couple who are dating — and mulling the next stage of their relationship.

“The script had all the things we love about ‘How I Met Your Mother,'” Bays said. “(‘Mother’) from episode one felt like a show we could get 100 episodes out of, and this does too. And we really connect as writers creatively with Kourtney and Joe. They’ve written some of the best episodes of ‘How I Met Your Mother.'”

“It’s charming character-driven comedy that has huge laugh-out-loud moments and very warm relationships at its core,” said 20th Century Fox TV chairman Dana Walden.

Bays and Thomas said the Kang/Kelly script contained plenty of “Mother” DNA but was different enough to rep their next evolution. Show is based in Pittsburgh, where Kang went to college.

“It feels like a logical extention of ‘How I Met Your Mother,’ with a couple at the center of it, instead of being about the single life,” Thomas said. “We grew up writing ‘Mother,’ and now we can figure out the next chapter of the story.”

With “Mother” now in season five and having already produced 100 episodes (the show has already been sold into syndication), Bays and Thomas said they felt the timing was right to explore what’s next.

“We’re not taking our eye off ‘How I Met Your Mother,'” Thomas said. “But it’s enough of a well-oiled machine.”

The producers said they’re inspired by other scribes with multiple shows — such as Seth MacFarlane, Josh Schwartz and Chuck Lorre — and saw how it can be done firsthand when they worked on season one of MacFarlane’s “American Dad.”

MacFarlane has used his “Family Guy” mother ship as a breeding ground for developing talent — something Bays and Thomas are now doing with “Mother.”

“That’s definitely a business model that has proven successful,” Thomas said. “Carter and I would be sitting at a writers’ room table and would see Kourtney and Joe pitching amazing things. You start to think about tapping into that creativity.

“We have a number of great writers on our staff,” Thomas added. “This experience has been successful enough for us to do this again. We’re dipping our toes into the water here.”

As for their new deal with 20th, Bays and Thomas noted that they’ve been with the studio since leaving “Late Show with David Letterman” and moving to Los Angeles without a job.

“We serendipitously wound up at 20th, where they helped us grow as writers,” Thomas said.

The duo worked on Steve Levitan’s “Oliver Beene” and on “American Dad” before hitting the big time with “Mother.”

“I would have signed them to a ten-year overall deal,” Walden said. “There really is nothing more gratifying for a studio person than starting with writers at the beginning of their career and watching them blossoming into extraordinary showrunners. Taking a meeting with them is a high point of any day.”

Bays and Thomas are repped by UTA.