You can make a transition asynchronous by adding a handler which pauses the transition, from any of its lifecycle events (transition, event or state) and at any point (start, leave, enter, end).
To do this you can:
truefrom the event handler
pause()on the state machine instance
Once paused, you can execute any asynchronous code you need to run, then
cancel() the event to finish the transition.
In the example above, the transition pauses on leaving Step 1, then completes by resuming the transition from a simple timeout