Table of Contents

Interface IFlowOrchestrator

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

Runtime-neutral entry point for the FlowOrchestrator execution engine. Implemented by FlowOrchestratorEngine; consumed by runtime adapters (Hangfire, in-memory pump, queue consumer) that handle the actual job dispatch.

public interface IFlowOrchestrator

Methods

RetryStepAsync(Guid, Guid, string, CancellationToken)

Resets a step's state and re-executes it from scratch. Used by the dashboard Retry button.

ValueTask<object?> RetryStepAsync(Guid flowId, Guid runId, string stepKey, CancellationToken ct = default)

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.

ct CancellationToken

Cancellation token.

Returns

ValueTask<object>

RunStepAsync(IExecutionContext, IFlowDefinition, IStepInstance, CancellationToken)

Executes one step: runs the handler, persists the result, and dispatches the next ready steps. Called by the runtime adapter when a dispatched step job fires.

ValueTask<object?> RunStepAsync(IExecutionContext context, IFlowDefinition flow, IStepInstance step, CancellationToken ct = default)

Parameters

context IExecutionContext

The ambient execution context carrying RunId and trigger data.

flow IFlowDefinition

The flow definition that owns this step.

step IStepInstance

The step instance with resolved inputs.

ct CancellationToken

Cancellation token.

Returns

ValueTask<object>

TriggerAsync(ITriggerContext, CancellationToken)

Starts a new flow run: persists trigger data, registers idempotency key if present, creates the run record, and dispatches entry steps.

ValueTask<object?> TriggerAsync(ITriggerContext context, CancellationToken ct = default)

Parameters

context ITriggerContext

Trigger context populated by the caller. JobId should be set to the runtime job or message ID before calling, if available.

ct CancellationToken

Cancellation token.

Returns

ValueTask<object>

An anonymous object with runId (Guid) and duplicate (bool).

TriggerByScheduleAsync(Guid, string, string?, CancellationToken)

Resolves the flow by flowId and starts a run via its cron trigger. Used by recurring job runtimes (Hangfire recurring jobs, cron daemon, etc.).

ValueTask<object?> TriggerByScheduleAsync(Guid flowId, string triggerKey, string? jobId = null, CancellationToken ct = default)

Parameters

flowId Guid

The flow to trigger.

triggerKey string

The manifest trigger key (e.g. "schedule").

jobId string

Optional runtime job/message ID to correlate with the run record.

ct CancellationToken

Cancellation token.

Returns

ValueTask<object>