Prompted by this answer, is it possible for your death to trigger a Contingency? If you're dead, how does the spell activate, and if it's then casting another spell, is it possible for that to happen if you as the spellcaster are dead?
Per Contingency, when you cast Contingency, you also cast the contingent spell, but it doesn't go into affect until the trigger event occurs.
Choose a spell of 5th level or lower that you can cast, that has a casting time of 1 action, and that can target you. You cast that spell—called the contingent spell—as part of casting contingency, expending spell slots for both, but the contingent spell doesn’t come into effect. [emphasis added.] Instead, it takes effect when a certain circumstance occurs. You describe that circumstance when you cast the two spells. For example, a contingency cast with water breathing might stipulate that water breathing comes into effect when you are engulfed in water or a similar liquid.
The contingent spell takes effect immediately after the circumstance is met for the first time, whether or not you want it to, and then contingency ends.
The contingent spell takes effect only on you, even if it can normally target others. You can use only one contingency spell at a time. If you cast this spell again, the effect of another contingency spell on you ends.
Also, contingency ends on you if its material component (a statuette of yourself carved from ivory and decorated with gems worth at least 1,500 gp) is ever not on your person.
So as long as your death doesn't cause the statuette to be destroyed or removed from your dead body, then your 5th level or lower spell should fire. Since you've already cast it and the contingent spell is just being held in check until the contingency event triggers the spell's release.