subFlow

@Suspendable
abstract fun <R> subFlow(@NotNull subFlow: SubFlow<R>): R

Executes the given SubFlow.

This function returns once the SubFlow completes, returning either:

  • The result executing of call.
  • An exception thrown by call.
Any open FlowSessions created within a SubFlow annotated with InitiatingFlow are sent:
  • Session close messages after successfully completing the SubFlow.
  • Session error messages when an exception is thrown from the SubFlow.

Return

The result of executing call.

Parameters

subFlow

The SubFlow to execute.

<R>

The type returned by subFlow.

See also

Throws

CordaRuntimeException

General type of exception thrown by most Corda APIs.