Paul Reubens did not tell his director that he was dying.

On July 31, 2023, the news of Reubens’ death came as a shock to documentary filmmaker Matt Wolf, who had spent a year trying to convince him to make the ambitious two-part documentary “Pee-wee as Himself,” now streaming on HBO Max, and over 40 hours interviewing him on camera.

But in 2023, the project was in danger of falling apart: The two had been at an impasse for a while over the issue of creative control and they’d finally found a way forward. He had one last interview scheduled, set for the first week of August. Then the texts started coming in. Wolf sat there shaking.

They’d spoken about everything — Reubens’ childhood, his complicated relationship with fame, his ambitions, his commitment to his alter-ego Pee-wee Herman, his sexuality, his arrest — except the fact that he’d been battling cancer for the past six years. But after the initial shock, a renewed purpose set in.

“I went to work the day after Paul died. I started to read the 1,500-page transcript of our interview through the night and was struck by the significance and meaning that came by understanding that he was privately contemplating mortality,” Wolf said. “I was aware that this was an extraordinary situation that was part of the story of the film and that the stakes were the highest I had ever experienced.”

For the next year, Wolf would wake up and say to himself, “You cannot drop the ball. Rise to the occasion.” It was, he said, “the most challenging and involved and emotional process of filmmaking that I’ve ever gone through and maybe that I’ll ever go through again.”

Reubens wanted to direct his own documentary. He’d always prized creative control and couldn’t fathom why he would cede it in telling his own story for the first time. But everyone around him seemed to think that was a bad idea. It would take over a year of getting to know Wolf, whose film credits include documentaries about cellist Arthur Russell and news archivist Marion Stokes, to consider letting go.

Even after Reubens had agreed to let Wolf direct the project, he continued to push back and resist at times. Early on, they decided to record their phone conversations as well, recognizing that their dynamic illuminated something true about Reubens.

“Right away, Paul was sort of rebelling against the process, blowing off steam, procrastinating, teasing me, sometimes being adversarial, but in a funny wink-wink way,” Wolf said. “I was frustrated. I thought, how am I ever going to get through this? This is the most resistant interview subject I’ve ever encountered. Then I realized this is actually a pretty significant form of portraiture. This is showing Paul’s discomfort and uncertainty about really showing and sharing himself.”

The result is a collaboration, Wolf said, but one in which he also had editorial control. It wasn’t going to be a hit piece, but it wasn’t going to be a puff piece either.

Wolf, 43, was part of the generation of kids who grew up with the children’s television series “Pee-wee’s Playhouse.” It was, he said, the first time he’d felt viscerally moved by a work of art.

Still, he wasn’t approaching the project as a fan. He was coming as a filmmaker who makes documentaries about gay artists and unconventional visionaries who “beg for reappraisal.” Unlike most of his subjects, however, Reubens was an icon and a cult figure.

“I was determined not to make a film that fell into the traps of the celebrity biopic with platitudes from other famous people and manufactured self-reflection,” Wolf said. “I wanted to make portrait of an artist.”