Ezra Miller’s cameo in The CW’s "Crisis on Infinite Earths" was done with careful consideration for Warner Bros. upcoming The Flash movie and its Flashpoint storyline. Producer Marc Guggenheim revealed he worked "hand-in-hand" with DC Entertainment to make sure everyone was on the same page.

"From the moment we found out that this was a possibility, to once we knew Grant Gustin was cool and on board with it and Ezra was on board with it, I would send drafts of the scene to both Jim Lee and [DC Entertainment’s film VP] Adam Schlagman and we would just go back and forth,” Guggenheim told Entertainment Weekly. “The trick with the scene is that I didn’t want to and they didn’t want me to do anything that stepped on the toes of the Flashpoint movie that they’re developing.”

Related: Crisis Showrunner Reveals Who Made The DCEU’s Top Secret Cameo Happen 

Guggenheim said Lee, DC’s Chief Creative Officer, was “really great” when it came to making sure “all the parties were talking to each other” and that nothing was stalled. “We really worked hand-in-hand,” Guggenheim explained. “He was a cheerleader when he needed to be, a diplomat when he needed to be … His enthusiasm really helped make this possible.”

Miller’s Flash cameo took millions of viewers -- and even some stars of the Arrowverse -- by surprise this week. It was ultimately Warner Bros.' idea for the DC Extended Universe version of Barry Allen to come face-to-face with Gustin’s.

“Crisis on Infinite Earths,” the latest five-show crossover between all the Arrowverse series, is now available on The CW’s streaming service in its entirety.

KEEP READING: Grant Gustin Thanks [SPOILER] For Crisis’ DCEU Cameo With Candid Set Photos