As the CW’s “Arrow” prepares to sign off after eight seasons, the writers had a difficult balance to strike in the final episode: acknowledging the changes that have come to Earth Prime in the aftermath of the timeline-changing “Crisis on Infinite Earths” arc, wrapping up the characters from the mothership series and also leaving enough of the characters unharmed that the future-set backdoor spinoff could potentially move forward.

Oh yeah, and dealing with the fact that its titular character Oliver Queen aka the Green Arrow (Stephen Amell) has been dead for two episodes.

“It was extremely challenging,” executive producer Beth Schwartz says. “In the end, all of those challenges is what made the ending so perfect.”

With Oliver dead after the events of “Crisis,” the finale will pay tribute to his sacrifice — and reveal a gaggle of changes that unfolded in the wake of the event. That also allowed for the series to bring back previously deceased characters like Susanna Thompson’s Moira Queen (who was killed off in Season 2) and Paul Blackthorne’s Quentin Lance (who perished in the Season 6 finale).

“We’ve had a lot of discussions about what’s new, but at the same time, because we have the possibly the spinoff, and there’s also all these other sister shows [in the ‘Arrowverse’], we’ve given ourselves the freedom to be [flexible],” executive producer Marc Guggenheim says. “It’s been the same approach that we’ve actually had with ‘Arrow’ for the last eight years, which is just because we’ve had these conversations doesn’t mean that we’re foreclosing a great idea if one comes along [later].”

But, Schwartz adds, there were a lot of conversations about which previously deceased characters could be brought back: “We were really setting the rules [for who was back and why]. And we spell it out in the in the finale.”

The finale episode, entitled “Fadeout,” also allows for present-day Felicity (Emily Bett Rickards, who departed the series at the end of Season 7) to meet her grown-up daughter. “There’s a lot of wish fulfillment,” Schwartz previews. “One, being a parent — and I’m a new parent — seeing your child in their adult self is really crazy and also amazing when you’re proud of who she became as a woman and also honoring her father’s legacy. [It was] not obviously under great circumstances because they’re at Oliver’s funeral, but I think it was a very meaningful moment in their lives.”

Though the “Arrowverse” will live on beyond “Arrow’s” Jan. 28 finale, it was important for the team to get emotional closure with the show’s final hour.

“It’s really important for me and Marc to honor all of our characters,” Schwartz says. “We spent a lot of time in the room brainstorming endings for all our characters, whether they were series regulars in Season 8 or they were series regulars in Season 1. We really wanted to give everyone a satisfying ending, so that you could envision what their lives would be like after the show was over.”

Adds actor David Ramsey, who played John Diggle for the show’s entire run: “This is the longest I’ve run on a show. So just being on a show where you just have this network with ‘The Flash,’ ‘Legends’ and ‘Batwoman’ and all this these tentacles, it’s just strange. It feels as if is over, but it’s kind of like, ‘Look at all my children! Look at this world we created.’ So it’s over but there’s also this legacy and this thing that we’ve kind of created that feels really special. We just used to these things ending and there’s a piece of this that just feels like it doesn’t, which is also very good.”