Does Sentinel happen BEFORE or AFTER resolving the triggering attack?

What’s the sense in giving a Demilich 80 HP making it vulnerable to Power word kill?

Nothic telepathy