Table of Contents

Class PollableStepHandler<TInput>

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

Base class for step handlers that need to repeatedly query an external system until a condition is met, using Hangfire's delayed scheduling for pacing.

public abstract class PollableStepHandler<TInput> : IStepHandler<TInput> where TInput : IPollableInput

Type Parameters

TInput

Step input type implementing IPollableInput.

Inheritance
PollableStepHandler<TInput>
Implements
IStepHandler<TInput>
Inherited Members

Remarks

Subclasses implement FetchAsync(IExecutionContext, IFlowDefinition, IStepInstance<TInput>) to perform the actual fetch. The base class manages:

Methods

ExecuteAsync(IExecutionContext, IFlowDefinition, IStepInstance<TInput>)

Executes the step with strongly-typed inputs and returns an optional result value.

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

Parameters

ctx IExecutionContext
flow IFlowDefinition

The flow definition currently executing.

step IStepInstance<TInput>

The step instance with inputs already deserialised to TInput.

Returns

ValueTask<object>

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

FetchAsync(IExecutionContext, IFlowDefinition, IStepInstance<TInput>)

Performs the actual data fetch against the external system.

protected abstract ValueTask<(JsonElement Result, bool IsJson)> FetchAsync(IExecutionContext ctx, IFlowDefinition flow, IStepInstance<TInput> step)

Parameters

ctx IExecutionContext
flow IFlowDefinition
step IStepInstance<TInput>

Returns

ValueTask<(JsonElement Result, bool IsJson)>

A tuple of the fetched JsonElement payload and a flag indicating whether the response was parsed as valid JSON (required for PollConditionPath evaluation).