1. A method for performing compensation work, the method comprising: receiving a definition of at least one compensation function as a closure data structure, wherein the compensation function implements compensation work for at least one event that can be encountered during execution of forward work; detecting during execution of forward work, an event triggering the at least one compensation work; and retrieving a process state associated with the compensation function based upon the closure; wherein the process state contains data needed to execute compensating work at a different runtime than the runtime of execution of the forward work.