State Machine Question

Hi im wondering how i can make a state play a animation once and then exiting the state and going back to the idle state.Right now its going from idle to the anmation i want played but when its finished its stuck in that state. I could call a function that opens up the transition but then id have to time it exactly. It feels like this should be doable from within the state machine itself, but i havent managed to figure out how.

nm figured it out.