Table of Contents

Interface IHangfireFlowTrigger

Namespace
FlowOrchestrator.Hangfire
Assembly
FlowOrchestrator.Hangfire.dll

Entry point for starting flow runs via Hangfire background jobs. Implemented by FlowOrchestrator.Hangfire.HangfireFlowOrchestrator.

public interface IHangfireFlowTrigger

Methods

TriggerAsync(ITriggerContext, PerformContext?)

Starts a new flow run from the given trigger context, enqueuing the entry steps as Hangfire jobs. Handles idempotency key deduplication when a key is present in the trigger headers.

ValueTask<object?> TriggerAsync(ITriggerContext triggerContext, PerformContext? performContext = null)

Parameters

triggerContext ITriggerContext

The trigger context including the flow, trigger event, and run metadata.

performContext PerformContext

Hangfire job context providing the background job ID; null when called outside a Hangfire job.

Returns

ValueTask<object>

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

TriggerByScheduleAsync(Guid, string, PerformContext?)

Resolves the flow by flowId and starts a run via its cron trigger. Called by the Hangfire recurring job registered for the flow's schedule.

ValueTask<object?> TriggerByScheduleAsync(Guid flowId, string triggerKey, PerformContext? performContext = null)

Parameters

flowId Guid

The flow to trigger.

triggerKey string

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

performContext PerformContext

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

Returns

ValueTask<object>