Hi @Teaf,
Your question is a duplicate of : State Machine Execution Sequence
The thread has no marked solution but two different approaches / suggestions which you can test yourself on a state machine in UiPath Studio.
As per the explanation of what the different stages do please read through : State Machines - Exit workflow and Trigger