Shonda Rhimes has admitted that she once feared she'd be "dead in ten years" because of her health.

The Grey's Anatomy and Scandal writer has revealed that her health was once so poor that she thought it would cut her life short.

Speaking at the Shonda Rhimes in Conversation with Robin Roberts: Year of Yes at 92NY on Tuesday, Shonda explained that she had started to focus on improving her health for the sake of her three children.

During their conversation, host Robin Roberts recalled how Shonda opened up about her health journey in the extended version of her book Year of Yes.

Robin said, "I love the story that you tell when your daughter, you put her on your shoulders and you were able to run around with her and up the steps and there's a time that you couldn't do that. And how you literally cried after."

"I did," Shonda replied. "I have little kids, guys and I really thought like I might be dead in 10 years."

"Like that's how bad I felt. And I couldn't, I couldn't put my 20 pound kid on my shoulders and run around, which I should have been able to do," the 55-year-old continued. "And so when that moment happened, when I could do that, it was such a moment of both relief and revelation for me that it's one of those memories I'll take with me forever."

Shonda shared that she had felt "joy" in that moment, and remembered thinking, "Oh my God, I feel myself again."

The television producer and screenwriter has three daughters, Harper, 22, Emerson, 12, and Beckett, 11.

Elsewhere in the conversation, Shonda opened up about how her unhealthy eating habits had affected her.

"At a certain point I started to feel like truly feel terrible. Like have a hard time going up the stairs, getting breathless all the time," she said. "Feeling like I had, like, I had sleep apnea, I developed sleep apnea and I like woke up all the time, choking in, in my sleep."

The Shondaland founder added, "Like I started to feel awful and I was like, I have to do something about this."