I don't have a great solution for this particular problem.
However any solution that you come up with has to be resilient enough that the nodes that execute such scenario are always available.
You don't just want a system with high availability, you want a system that will stand the test of time. For example, it might trigger 30 or 50 years from now. You might not want to use AWS or Google or Azure or any sort of system like that. They don't seem to keep their solutions available for that long. So you'll need to host something yourself and make sure it's resilient to a multitude of scenarios that might bring the "back end" down.
You'd also need to set-up some sort of test for the system to make sure it's still running and it'll do what you want it to. Maybe it runs every 3 months or so like a fire system drill.
Honestly the trigger can be something as simple as you hitting a button connected to your system every week with a way for it to ping and prompt you to do it you if you haven't "reset" the counter in a timely fashion.
I would probably do something like that with a weekly cadence and a whole other week to make sure I don't miss the reset.
You probably also want to be able to set it to different modes if you think you will be away for a while. Like a vacation mode or oh shit I'm in the hospital mode.
Additionally, I also wouldn't be as fatalistic as sending goodbyes to everyone. I would use it more as a system to sound an alarm that I'm not okay and something has happened to me and communicate that with people who could do something about it. Like verify if I'm alive or not, or contact local authorities to post a missing persons report.
This same system of notifying could also allow closer people to me to trigger an "oh shit I'm dead mode" which would then execute whatever is in that idea of yours.
Found the Microsoft employee.