SPOILER ALERT: Do not read if you have not yet watched “When the Saints Go Marching In,” the series finale of “The Originals.”

It takes deep canon and a rabid fandom to develop a young adult novel and parlay that into three standalone series, a world of revolving (not to mention evolving) characters, and more than 250 episodes of television. Creator and executive producer Julie Plec has certainly thought long and hard about such worlds, first with the eight-season long “The Vampire Diaries” last year and more now with the end of spinoff series “The Originals.”

As the CW supernatural show wrapped its five-season run ahead of this October’s debut of second spinoff series, “Legacies,” Plec was aware of how one show’s ending might influence the other’s beginning, whether it made logistical sense to keep certain characters alive in wrapping “The Originals,” and what the fandom might expect from it all.

“I’m glad we got to bring the story to its full completion with the blessing of the studio and the network, and I’m glad we got to bring the full experience to the fans,” Plec tells Variety. “Whether they want me dead or not when it’s over, it was a very creatively satisfying journey for us in the writers room and for myself in particular. I’m proud of it, even though I know it’s tragic.”

In the end, “When the Saints go Marching In” featured several guest star cameos, said farewell to brothers Klaus (Joseph Morgan) and Elijah Mikaelson (Daniel Gillies) when the characters sacrificed themselves in a dual-stake death to save “Legacies lead Hope (Danielle Rose Russell), and doled out something of a happy ending as Rebekah (Claire Holt) and Marcel (Charles Michael Davis) finally figured out how to be together.

Here, Plec talks with Variety about wrapping the New Orleans-based series while launching a new one, why certain characters seem to transcend these worlds, and the “Obi-Wan Kenobi” of it all.

Did having a spinoff in the works influence how you ended “The Originals”?

Had Joseph Morgan and Daniel Gillies been knocking on my door saying, “Please let us show up on the spinoff, we’re so excited, we want to continue on this legacy,” I might have thought twice about saying goodbye to both of them. But in the absence of that enthusiasm I felt like it was right and poetic and it was beautiful even as it was tragic to say goodbye to both brothers.

At what point did you come to realize one brother might not be able to live without the other?

That was a realization that was always a spiritual understanding we had about the brothers, but that we didn’t actualize until season 5. We always figured we’d be able to bring one of them full circle and release them from their immortal curse, the idea being that in a thousand years of living you’ve lived multiple lifetimes and so there is a point when living remains more of a curse than dying. We always knew we wanted to do that, but the dissembling of the partnership — the do death do us part and then letting death part them — was when we decided with Elijah, in the part he played in not being able to protect Hayley [Phoebe Tonkin] from her death that it felt like his own death was a reductive act for that.

When you’re writing a last season, and you know it’s the last season, and you have this ending in mind, at what point do you have to actually start writing towards that?

The best part about knowing the show is coming to an end is that you enter the writing of the final season with absolute carte blanche to do anything you’ve ever wanted to do and with the understanding that where you are taking your characters at the end of the season is where you are leaving them in perpetuity. So the final seasons, now that I’ve done it a couple of times, are the easiest to write of all the seasons because you are driving along a very clear path — even if the results at the end of the path change organically over the course of the season, the end of the path is clear. It’s a marvelous experience.

Does knowing that give you more time and liberty to pursue returning guest stars you want to see one more time before the series closes?

In my opinion the return of guest stars or former series regulars is a little bit of a fan-wink and a nod. It’s a thank you to the fandom for being fans. It’s fun for us as writers and storytellers to be able to revisit some character favorites that we’ve missed. It’s fun for us as producers and people to be able to invite the people that we love back to the party one last time. I’m sure shows would end just fine without visiting all those faces, but it would be a lot less fun and a lot less emotional.

Could you have imagined letting fans say goodbye to Klaus without that last moment with Caroline [Candice King]?

I have to believe there are plenty of fans who would have been just fine, but as a fan of them myself, I’m glad to have been able to give them that final moment.

When you first introduced Klaus so many years ago could you have imagined such a poetic ending for him? Were you surprised at how much he developed and evolved?

The pitch for the series when I went in and said I wanted to do a spinoff and talked about what I wanted it to be, the pitch was to take Elijah Mikaelson, the most honorable man in the world, to dishonor himself along the road to finding his brother’s most pure redemption. That is a road map we stuck to all along. As Klaus became a better human being, Elijah found himself flipping into different kinds of darkness. In a way this season was about taking Elijah to his deepest point and then bringing him back to a place of love and honor and sacrifice, which is the character we love that has existed for a thousand years.

What about ending this journey for some of the other siblings — namely Rebekah and Marcel. Why was it important to have some sort of happy ending?

All Rebekah has ever wanted was to go out into the world and to live as close to a human life as she possibly could. It’s something she wanted in “The Vampire Diaries,” it’s something she brought with her to “The Originals,” it’s the thing that kept her and Marcel ultimately from being able to be together and it’s the thing that ultimately caused the most grief in her relationship with her family. We knew, all along that we wanted to give her some kind of happy ending. And when the cure remained in the canon and the end of “The Vampire Diaries,” we were able to say, “Oh that’s how we get Rebekah what she wants.”

What is it about Caroline and even Alaric [Matt Davis] that transcends these series for you?

That has probably as much to do with the spinoff as anything, which is when I realized I wanted to do a next-generation “Vampire Diaries” and set it at the boarding school, that cemented Caroline and Alaric into the canon of that show. That was the beginning of the final season of “The Vampire Diaries.” So, we had a couple of years now to integrate them into that world. Being able to drop into that school and see Caroline and Alaric and the twins again was about reminding the audience that there’s a whole other world out there that’s ready to be explored.

Looking forward, what kind of role could the surviving Mikaelsons play in “Legacies?”

What I like to say, and I mean it wholeheartedly, is that the door is always open. If anybody wants to come, I will find a way to make that work. I would love to see Vincent [Yusuf Gatewood] come teach some classes, or Auntie Freya [Riley Voelkel] show up for the parent-teacher weekend. Rebekah sneaking Hope out of school for a fun getaway — all that stuff is stuff I would love to see so it’s really just a matter of, at what point do these guys feel like paying homage to these characters and revisiting a character that they’ve already put to bed. That might take some time, but maybe we’ll see them eventually.

Does knowing that door stays open make Klaus and Elijah’s deaths a little harder to swallow as a writer who has written them for so many years?

It does and it doesn’t. The one thing that we’ve done over the years across both shows is make excellent use of the dream sequence. We’ve been very liberal with the ease in which we bring people back to life. So, if one day Joseph Morgan knocked on my door I could find a way to make it work. There’s an Obi-Wan Kenobi philosophy of cameos that I always love as well.