Table of Contents

Class DefaultStepExecutor

Namespace
FlowOrchestrator.Core.Execution
Assembly
FlowOrchestrator.Core.dll

Default implementation of IStepExecutor that resolves the matching IStepHandlerMetadata by type name, evaluates @triggerBody(), @triggerHeaders(), and @steps() input expressions via the FlowOrchestrator.Core.Execution.Internal.InputResolutionPipeline + FlowOrchestrator.Core.Execution.Internal.StepExpressionResolutionPipeline, injects the enclosing ForEach iteration context via FlowOrchestrator.Core.Execution.Internal.LoopScopeInputs, and delegates execution to the registered handler.

public sealed class DefaultStepExecutor : IStepExecutor
Inheritance
DefaultStepExecutor
Implements
Inherited Members

Constructors

DefaultStepExecutor(IEnumerable<IStepHandlerMetadata>, IServiceProvider, IOutputsRepository, IFlowRunStore)

Constructs the executor with the registered step handler metadata, service provider, outputs repository, and run store.

public DefaultStepExecutor(IEnumerable<IStepHandlerMetadata> handlerMetadata, IServiceProvider serviceProvider, IOutputsRepository outputsRepository, IFlowRunStore runStore)

Parameters

handlerMetadata IEnumerable<IStepHandlerMetadata>

Every registered handler. Indexed by step type once here rather than scanned per execution: the lookup used to be a FirstOrDefault with a closure, i.e. O(registered handlers) plus an allocation on every step the engine runs. The registry is fixed for the lifetime of the executor, which is exactly the case FrozenDictionary<TKey, TValue> exists for — build once, read forever, faster reads than Dictionary<TKey, TValue>.

serviceProvider IServiceProvider

Used to resolve the handler instance for the matched type.

outputsRepository IOutputsRepository

Persists resolved step inputs and outputs.

runStore IFlowRunStore

Run/step bookkeeping.

Remarks

Duplicate registrations for the same type keep the FIRST entry, matching the previous FirstOrDefault behaviour. Matching stays ordinal case-insensitive.

Methods

ExecuteAsync(IExecutionContext, IFlowDefinition, IStepInstance)

Resolves inputs (trigger and step-output expressions), saves them to the output store, then invokes the handler registered for step's type. Returns Skipped if the step metadata or its handler cannot be found.

public ValueTask<IStepResult> ExecuteAsync(IExecutionContext context, IFlowDefinition flow, IStepInstance step)

Parameters

context IExecutionContext

The execution context for the current run.

flow IFlowDefinition

The flow definition that owns this step.

step IStepInstance

The step instance with pre-resolved inputs.

Returns

ValueTask<IStepResult>