Kathryn Hahn has been cast in the upcoming Apple series “The Shrink Next Door,” Variety has learned.

Inspired by true events documented in the Wondery and Bloomberg Media podcast of the same name, “The Shrink Next Door” is described as an eight-episode dark comedy following the bizarre relationship between psychiatrist to the stars Dr. Isaac “Ike” Herschkopf (Rudd) and his longtime patient Martin “Marty” Markowitz (Ferrell).

Hahn will star as Phyllis, Marty’s younger sister. She has appeared in projects with both Ferrell and Rudd in the past, including a role in the hit comedy film “Anchorman.” She would go on to star with Ferrell in the feature “Step Brothers.” She also appeared in Season 4 of “Parks and Recreation” alongside Rudd.

Hahn’s other roles include “Transparent,” for which she was nominated for an Emmy in 2017 for best supporting actress in a comedy. She also recently led the HBO limited series “Mrs. Fletcher” and the Amazon series “I Love Dick.” She will appear in the Marvel Disney Plus series “WandaVision,” which will launch on the streamer later this year. On the feature side, Hahn is known for her starring role in the “Bad Moms” franchise.

She is repped by Gersh, Brillstein Entertainment Partners, and Schreck Rose.

“The Shrink Next Door” hails from Civic Center Media in association with MRC Television. “The Big Sick” director Michael Showalter is on board as a director, with “Succession” and “Veep” scribe Georgia Pritchett set to pen and showrun the dark comedy.

Pritchett, Rudd and Ferrell are also executive producing, the latter via his Gloria Sanchez Productions banner. Jessica Elbaum and Brittney Segal are also attached as executive producers for Gloria Sanchez.

Showalter and Jordana Mollick will executive produce on behalf of Semi-Formal Productions, with Marshall Lewy exec producing for Wondery, and Jared Sandberg, Katie Boyce, and Francesca Levy for Bloomberg Media. Original podcast host Joe Nocera is involved as a co-executive producer.