run
The run() function is the entry point of the flow system. It executes a synchronous or asynchronous flow, handles effects such as breaks, exits, finalizers, steps, and injections, then returns the final value.
Interactive example
Syntax
typescript
function run<
GenericFlow extends TheFlowFunction | TheFlow
>(
theFlow: GenericFlow,
params?: {
input?: unknown;
includeDetails?: boolean;
dependencies?: Record<string, unknown>;
}
): unknownParameters
theFlow: The flow function or created flow to execute.params.input: Optional input passed to the flow.params.includeDetails: Whentrue, returns an object with the final result and collected step names.params.dependencies: Dependency bag used to satisfyF.inject()requests.
Return value
The final flow result, or a Promise when the executed flow is asynchronous. When includeDetails is enabled, the return value becomes { result, steps }.
