Class FlowExecutor
- Namespace
- FlowOrchestrator.Core.Execution
- Assembly
- FlowOrchestrator.Core.dll
Default IFlowExecutor implementation.
Persists trigger data via IOutputsRepository and resolves the
entry and successor steps based on linear runAfter relationships.
public sealed class FlowExecutor : IFlowExecutor
- Inheritance
-
FlowExecutor
- Implements
- Inherited Members
Remarks
This implementation handles simple linear flows. Complex parallel/loop graphs are driven by FlowGraphPlanner in the Hangfire layer.
Constructors
FlowExecutor(IOutputsRepository)
Initialises the executor with the outputs repository used to persist trigger data.
public FlowExecutor(IOutputsRepository outputsRepository)
Parameters
outputsRepositoryIOutputsRepository
Methods
GetNextStep(IExecutionContext, IFlowDefinition, IStepInstance, IStepResult)
Evaluates the flow graph after currentStep completes and returns
the next IStepInstance to enqueue, or null if the run is finished.
public ValueTask<IStepInstance?> GetNextStep(IExecutionContext context, IFlowDefinition flow, IStepInstance currentStep, IStepResult result)
Parameters
contextIExecutionContextThe ambient execution context for this run.
flowIFlowDefinitionThe flow definition being executed.
currentStepIStepInstanceThe step that just finished.
resultIStepResultThe result of the completed step, used to check
runAfterconditions.
Returns
TriggerFlow(ITriggerContext)
Persists trigger data, then builds and returns the first IStepInstance to be enqueued as a Hangfire job.
public ValueTask<IStepInstance> TriggerFlow(ITriggerContext context)
Parameters
contextITriggerContextThe trigger context carrying the flow, trigger event, and run metadata.
Returns
- ValueTask<IStepInstance>
The entry step instance ready for enqueueing.
Exceptions
- InvalidOperationException
Thrown when the flow manifest contains no step with an empty
runAfter.