What node to use for previoius state -> new state -> trigger?

I’m writing a Manual Alarm / Node-RED combo, and I’m having trouble visualizing what I need to differentiate between Armed_Away -> Triggered (This would start a pending status to give time to disarm), and Armed_Home -> Triggered (which would immediately casue the alarm to trigger). Is it a state machine? I’ve been looking into it, but I cannot wrap my head around it.

I know how to do this in YAML, but for the life of me cannot figure it out in Node-RED. What node could I use to achieve this?

I’m a dummy.

“trigger-state” node will do exactly this…

You know… That node I’ve used at least three times so far, and then forgot it exists…