Unrelated, but somewhat similar in higher level, you can transfer state with durable execution, e.g temporal.io.
Instead of RAM, program's state saved in DB and execution environment resume in the previous state when restarted
Instead of RAM, program's state saved in DB and execution environment resume in the previous state when restarted