How do make an AI runaway when it is hurt by the player?

I want to make an AI run away when it’s hurt by the player and wait some time and then come back to the player using the behavior tree? How do I do that?