Many functions can not be persisted easily because they access variables from external environments (they are closures). A persistence mechanism would have to pick up that context as well.
If the function can change In this context, it will not be possible to keep the function + context in one process and to restore it in another process, since the secondary effects of executing the function would not be visible in the first process.
In your case, it is likely that the solution does not persist in the context of a function, but encodes the promises as events that can be stored explicitly: then you can try again to execute some code until an exit event is generated. Modeling something explicitly is often a sensible approach when the main language can not express some concept directly.