Table of Contents

Interface IHangfireStepRunner

Namespace
FlowOrchestrator.Hangfire
Assembly
FlowOrchestrator.Hangfire.dll

Executes individual flow steps as Hangfire background jobs. Implemented by FlowOrchestrator.Hangfire.HangfireFlowOrchestrator.

public interface IHangfireStepRunner

Methods

RetryStepAsync(Guid, Guid, string, PerformContext?)

Resets a Failed step and dispatches a fresh attempt of it; see RetryStepAsync(Guid, Guid, string, CancellationToken). The attempt runs as its own job, not inside this one, and the returned value is a StepRetryResult.

ValueTask<object?> RetryStepAsync(Guid flowId, Guid runId, string stepKey, PerformContext? performContext = null)

Parameters

flowId Guid

The flow that owns the run.

runId Guid

The run containing the step to retry.

stepKey string

The key of the step to retry.

performContext PerformContext

Hangfire job context.

Returns

ValueTask<object>

RunStepAsync(IExecutionContext, Guid, IStepInstance, PerformContext?)

Back-compat entry point for step jobs enqueued by FlowOrchestrator 1.17 – 1.x, which passed the full execution context and step instance as job arguments. Hangfire resolves a stored job by its exact method signature, so this overload keeps those in-flight jobs runnable across the upgrade. New dispatches always use RunStepAsync(HangfireStepEnvelope, PerformContext?).

[Obsolete("Only resolves step jobs enqueued before 2.0. New jobs use RunStepAsync(HangfireStepEnvelope, PerformContext?). Drain those queues before the next major release removes this overload.")]
ValueTask<object?> RunStepAsync(IExecutionContext ctx, Guid flowId, IStepInstance step, PerformContext? performContext = null)

Parameters

ctx IExecutionContext

The execution context deserialised from the legacy job payload.

flowId Guid

The flow that owns the step.

step IStepInstance

The step instance deserialised from the legacy job payload.

performContext PerformContext

Hangfire job context; null when called outside a Hangfire job.

Returns

ValueTask<object>

RunStepAsync(HangfireStepEnvelope, PerformContext?)

Executes the step described by envelope, persists its output, and enqueues any subsequent ready steps. Called by Hangfire when the step's background job fires.

ValueTask<object?> RunStepAsync(HangfireStepEnvelope envelope, PerformContext? performContext = null)

Parameters

envelope HangfireStepEnvelope

Ids, inputs and scheduling data of the step. The flow definition is resolved from FlowRegistry and the trigger payload from the run's stored trigger data, so neither travels through Hangfire's argument store.

performContext PerformContext

Hangfire job context; null when called outside a Hangfire job.

Returns

ValueTask<object>