Table of Contents

Class ForEachStepHandler

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

Built-in step handler for the "ForEach" step type. Resolves the iteration source via FlowOrchestrator.Core.Execution.Internal.ForEachSourceResolver, then returns a StepDispatchHint instructing the engine to enqueue each child step.

public sealed class ForEachStepHandler : IStepHandler
Inheritance
ForEachStepHandler
Implements
Inherited Members

Remarks

Concurrency is controlled by ConcurrencyLimit: items are bucketed and successive buckets receive a small scheduling delay (100 ms per bucket) to throttle parallel execution. Child steps receive __loopItem and __loopIndex injected into their inputs.

Methods

ExecuteAsync(IExecutionContext, IFlowDefinition, IStepInstance)

Executes the step and returns an optional result value. Return a IStepResult (e.g. StepResult or StepResult<T>) to control status, output, and retry delay; return any other value to implicitly succeed.

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

Parameters

context IExecutionContext

The ambient execution context for this run (RunId, trigger data, etc.).

flow IFlowDefinition

The flow definition currently executing.

step IStepInstance

The step instance with resolved inputs.

Returns

ValueTask<object>

The step output, or a IStepResult to control execution behaviour.