corda / net.corda.core.flows / FlowExternalAsyncOperation / execute


abstract fun execute(deduplicationId: String): CompletableFuture<R>

Executes a future.

The future created and returned from execute must handle its own threads. If a new thread is not spawned or taken from a thread pool, then the flow worker thread will be used. This removes any benefit from using an FlowExternalAsyncOperation.


deduplicationId - If the flow restarts from a checkpoint (due to node restart, or via a visit to the flow hospital following an error) the execute method might be called more than once by the Corda flow state machine. For each duplicate call, the deduplicationId is guaranteed to be the same allowing duplicate requests to be de-duplicated if necessary inside the execute method.