Maybe this is not the best way to achieve it, but you can call a function when a specific animation finished by calling a method in the last frame in the AnimationPlayer node.
When the AnimationTree play's the animation in the last frame, the function will be called.
I used C#, but the idea is the same, here are the steps in images:


Choose the node with your script attached, in my case is the Player's node.

in my case I'm using c#, but the idea is the same, create a function to call at the end of an animation.

After writing our function to call, then we go back to Godot editor and at the last frame we insert the key, but this case in the Player Functions' Track



We're done! Test it and I hope you like it. One more thing, we can use the same method for different animations, just insert the new track in the other animations, insert the key in the last frame and select your method/function.