In this exclusive essay for TheWrap, guest columnist Stephen Tobolowsky tells the surprising story behind how he came to be in Thursday's episode of "Community," on which he plays a professor obsessed with "Who's the Boss?"

Tobolowsky has appeared in more than 200 movies and TV shows, including "Groundhog Day," "Curb Your Enthusiasm" and "Glee." He's also writes a lot: His Slashfilm.com podcast, The Tobolowsky Files, is absolutely worth your time, and you should totally follow him on Twitter.

I'm Stephen Tobolowsky, and when I’m not acting in something, I am usually writing stories about acting. TheWrap asked if I would contribute a funny story about my guest appearance on Thursday’s episode of the NBC sitcom “Community,” and I initially said yes.

But I can’t do it.

I can’t do it for a very specific reason, though. It is a reason that has been a secret until now.

There is a saying in the Talmud, which is a set of holy books in Judaism, second in importance only to the Bible, that goes something like this: “You should always honor the place where you have derived benefit.”

It is the time for me to honor “Community.”

On January 6 of this year, I ended up in a very surprising position: on a gurney, being rolled into an operating room for open-heart surgery. There are no words for the fear such patients go through at that moment — for many different reasons, a lot of them unexpected.

The obvious one is the moment when they call you back to get prepped for surgery and you kiss your wife goodbye. And you both realize it may be for the last time.

Another scary moment is at the other end of the tunnel. When you wake up, you have no idea what will be left. Will you ever be the same? Will you ever work again?

Enter “Community.”

Tobolowsky's essay resumes after this preview clip from Thursday's episode.

Shortly after my surgery, Emily Cutler, one of the writer-producers on the show, contacted me to say that she was writing a part for me — a professor teaching a class about "Who's the Boss?" who squares off with Abed (Danny Pudi) about trivia relating to the 1980s sitcom. My agent and manager explained my situation, that I was still recovering. Emily still wanted me for the part. She said that she would write it in such a way that I could simply sit or stand and do it. She would change anything that was too taxing for me to do. How could I refuse?

We shot the episode February 3rd, just shy of a month after the surgery. I was still stapled together at that point, and relying on extra strength Tylenol as one of the four basic food groups. Only Emily, director Joe Russo and Dan Harmon, the creator of the show and captain of the ship, knew about my situation.

I arrived on the set with my wife, Ann, and a blood-pressure cuff in hand. Joe approached me first thing and said, “Today we will work our schedule around you. If you need anything, if you need a break, if something is too much — you just give me the sign and we’ll stop.”

We did three scenes that day. It would have been impossible without the care and concern of Emily, Joe, Dan and a few other key members of the production team that had been made aware of my condition.

Despite my fears and an occasional stratospheric jump in my diastolic pressure, my body allowed me to have a great time during the shoot. Along the way I got to see some of my old friends. Yvette Nicole Brown was on the set — she and I had done “Little Black Book” together. That was one of Brittany Murphy’s last films. Even though Yvette and I hadn’t seen each other in years, we immediately were transported back to that time and place. We shared some laughs about the filming of the movie and of course revisited the shock and sadness of losing Brittany so suddenly. It is amazing how intense friendships can be when you are only joined by the chaos of making a film.

At some point during my shoot with Danny, Chevy Chase stuck his head in to say hello. Chevy and I had done two films together: “Memoirs of an Invisible Man” and “Hero.” I told him that I had never forgotten what he told me on the set of the latter.

Three thousand bits of data streamed across Chevy’s face, and it went into involuntary spasms. He had no idea if I was talking about tips on comedy or about material for blackmail. After a couple of Chase-ian stammers, he asked, “And what might that have been?”

I laughed and said, “You’re the one who told me that when you work on a movie to always ask for your clothes.”

Chevy nodded and said, very seriously, “Stephen, you should always wear clothes. Especially in movies. Even more so during interviews. Interviews without clothes always go poorly.”

I laughed, as Joe stepped up and asked if I was ready for another take. I said, “Sure.” Chevy gave me a hug and disappeared down the hallway.

In the end, I was the beneficiary of so much more than getting to work on a hit show. Because of the generosity of spirit shown to me by those in the know at “Community” and their willingness to step over the line of comfort and give me a job at a moment when I was most afraid, I was able to feel the most overlooked element of the recovery process — a sense of purpose.

At a time when my heart was in question, my friends on “Community” stepped up and offered me theirs.