1. A method for generating an idempotent workflow comprising: detecting distributed code; identifying a boundary function in the distributed code that executes at least a first portion of the distributed code on a first computing device and at least a second portion of the distributed code on a second computing device different from the first computing device; separating the boundary function into a transition function that identifies a transition from the first computing device to the second computing device, a non-idempotent function that modifies parameter values, and a reversion function that terminates a session; transforming the non-idempotent function into an idempotent function by including code in the non-idempotent function so that the non-idempotent function is executed once; generating a flag corresponding to the non-idempotent function, wherein the flag indicates if the non-idempotent function has been executed; and combining the transition function, the idempotent function, and the reversion function to form the idempotent workflow; wherein the boundary function comprises a transition from a local process to a remote process; and wherein the idempotent function comprises code to produce a single output value from multiple executions of the idempotent function.