Williams wrote the song with songwriter Mary Gauthier
a few years before recording it for Glasshouse Children
. He'd always wished for Dolly Parton to accompany him on it, so he sent her the track along with a two-page letter. Dolly replied, saying she loved the tune and would be honored to sing on it. Asked by Billboard
what he put in a letter that convinced the country legend to sing with him, Williams replied:
"Real emotions, real words. I spoke of my life, my childhood, what 'Happy All the Time' means to me, and how validating it would be for me for her to sing with me. I think she really felt connected to the message of the song and just me in particular, for some reason."