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
flowIdGuidThe flow that owns the run.
runIdGuidThe run containing the step to retry.
stepKeystringThe key of the step to retry.
ctCancellationTokenCancellation token.
Returns
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
contextIExecutionContextThe ambient execution context carrying RunId and trigger data.
flowIFlowDefinitionThe flow definition that owns this step.
stepIStepInstanceThe step instance with resolved inputs.
ctCancellationTokenCancellation token.
Returns
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
contextITriggerContextTrigger context populated by the caller. JobId should be set to the runtime job or message ID before calling, if available.
ctCancellationTokenCancellation token.
Returns
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
flowIdGuidThe flow to trigger.
triggerKeystringThe manifest trigger key (e.g.
"schedule").jobIdstringOptional runtime job/message ID to correlate with the run record.
ctCancellationTokenCancellation token.