Table of Contents

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

outputsRepository IOutputsRepository

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

context IExecutionContext

The ambient execution context for this run.

flow IFlowDefinition

The flow definition being executed.

currentStep IStepInstance

The step that just finished.

result IStepResult

The result of the completed step, used to check runAfter conditions.

Returns

ValueTask<IStepInstance>

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

context ITriggerContext

The 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.