I don't know how exacly you are organizing your animations and states, but there is a function called "yield", that should allows you do what you want.
You can use it in many ways, and you can check it here
To call a function after an animation ends, you do:
yield(get_node("AnimationPlayer"), "animation_finished")