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:
true
from the event handlerpause()
on the state machine instanceOnce paused, you can execute any asynchronous code you need to run, then resume()
or 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