Yeah sorry, I should have done a better job of explaining. The fact that this happens in an external tree is irrelevant. I just meant a subtree. I want to know if there is a way to tell when a specific subtree is aborted. I could put the "unclaim" script in every possible tree that can abort this tree or cobble some bool / event together but I just wanted to check if there's a built-in way to basically say, "hey, if this subtree is cancelled mid-run due to a conditional abort, run this code".
The claiming unclaiming thing is just the agent marking an object for its use. If, for example, the agent gets attacked by something and the "hurt" subtree aborts the current tree before it unclaims that object, no other agents will be able to use that object. Basically it's like I give a key to an object to the agent and say, only you can open this door but then a wolf attacks him and he runs off with the key. I'd rather not use an on Update check on every single item with a key or copy pasting "give the key back" to every single tree that can abort this one so I'm looking for a better alternative.