SPOILER ALERT: Do not read if you have not yet watched “This Big, Amazing, Beautiful Life,” the penultimate episode of the second season of “This Is Us.”

Deja (Lyric Ross) is already an honorary Pearson — but on the latest episode of “This Is Us,” things moved closer toward her becoming a permanent family member.

After being temporarily placed with Randall (Sterling K. Brown) and Beth (Susan Kelechi Watson) when her mother Shauna (Joy Brunson) was arrested, Deja ended up going back home when her mother got out of jail and proved she had a safe and clean place for them to live. But things quickly turned south again when Shauna used her hard-earned money to pay her boyfriend’s bail and got so behind on her rent she was evicted.

Randall and Beth found Deja and her mother sleeping in their car and promptly brought them home with them — where Shauna saw her daughter act like a kid for the first time and realized she might be better off under the Pearson roof.

Here, “This Is Us” executive producer Isaac Aptaker breaks down the montage-filled episode, giving Deja her own flashbacks, casting Pam Grier as her great-grandmother, and working in the rest of the Pearson clan.

How did the response to Deja’s first appearance alter your original plans for the character and that part of Randall’s arc?

We always had imagined her as a big part of the show — we had hoped. But whenever you’re bringing on guest cast, and especially younger cast, you never know exactly how it goes so you don’t want to get too far ahead in case it doesn’t work out. This is one where she just exceeded all of our expectations. I remember being on set — I think it was her very, very first scene with us — and she has a scene where she gets into a fight with Sterling and Susan runs in. It’s a very, very tense scene, and she just absolutely nailed it. And then they said, “Turning around,” which means move the lights and move the cameras and happens 8000 times a day on a set, but she was so new, she said, “What’s turning around?” And it was like, “How did you just deliver that performance and yet you have never done this before!?” She is such a powerful presence on-screen — her and Sterling, her and Susan together, we just think they are so captivating to watch. We love the new energy and the new dynamic she brings into what can be a very safe, idyllic household. So this was always our hope for the character — that she could be this big for the show — but when you’re casting a brand new character you never say. “Yes we’re going to devote a full episode to her” until you can see what she can do.

What made you want to dive into a full Deja episode, as opposed to letting her story trickle out through flashbacks the way the other backstories have?

In the writers’ room we have a whiteboard that’s like our very special episodes whiteboard for really outside of the box ideas, which we’re always encouraging our writers to come in and pitch. And we try to devote a couple of episodes a year to that. Last year we did the one where you see the day the Big Three were born and you see the firefighter’s perspective and Dr. K’s perspective. We always try to have a couple of those a season — that really break out of our typical mold and don’t necessarily advance our main narrative — so we thought, “Why don’t we do an episode that really tells the entire 12-year history of this girl’s life and really dives into the moments in between the stuff we’ve seen at Beth and Randall’s?”

Where did the montage-style structure of the episode come in?

We divided it up into the chapters of her life — the chapter she spent with her great-grandmother and then that pivotal turn where she passes away and she starts bouncing around foster homes. Her life really does have these real chapters and markers to it.

Why was it important to work the rest of the Pearsons into the episode through glimpses at their struggles that seemed to match what Deja was going through?

One of the themes of our show is that we all seem different but how there’s so much that’s universal to the human experience. When you look at it there’s so much more to us that’s the same than that’s different. So we wanted to show, as Deja was going through these seminal moments and having these experiences, the characters we’ve come to know in similar experiences — just to draw a connection between all of us. Deja, as a 10-year-old black girl living in a lower income neighborhood, is having the exact same experience Jack was as a little white kid in a middle class home back in the ’60s. It’s going through time and memories and class and all of these barriers to show there’s really a lot of shared experience there.

Were there concerns about just how much you had to pack into the episode?

That’s a constant struggle. Episodes are always coming in long and we’re always biting off more than we can chew. This one was particularly ambitious. I think this one had something like 92 scenes and a ridiculous amount of setups. We have an amazing production team. At first they stare at you and look like they’re going to pass out but then slowly come up with a plan and figure it out, and they always get it done for us. This one, a lot of these were just tiny moments, so production-wise, it involved building these two-wall sets for a little pop. It involved really, really creative use of the Paramount lot to make things look like other things. And then just, we have so much footage now in our 36 episodes to pull from, that for a lot of these pops there was either stuff we hadn’t aired before or alternate coverage we hadn’t seen so we could fill up the episode with existing footage, too.

How did you get Pam for the role? 

Pam was in Colorado but she flew in and we got her to hang with us for a few episodes. She was so good. We had realized we only saw such a tiny bit of [Deja’s] story, and she was in a lot of ways really quite a mystery. We had fragments of information we got through her file and through her mom, who we had met a couple of times, but she was unknown to us in a lot of ways except through this very specific context of being a foster child in Beth and Randall’s house. [Her relationship with her great-grandmother] was a chance to get much more.

How does this episode influence what’s to come in the season finale?

It’s very different for Deja to be in the house when her mom’s in jail and her mom can’t take care of her and when her mom is just saying, “I think you’re better off here. I don’t want to take care of you.” That new dynamic — that new color on it — really throws everybody for a loop. So we pick up in [the finale] really right after these events, and it’s about Beth, Randall and the girls confronting the new reality in their household, while also having to go to a big family wedding, which is not an ideal situation for adjusting to the situation.

“This Is Us” airs Tuesdays at 9 p.m. on NBC.