Table of Contents

Class TriggerContext

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

Default mutable implementation of ITriggerContext. Constructed by HangfireFlowOrchestrator.TriggerAsync before execution begins.

public sealed class TriggerContext : ITriggerContext, IExecutionContext
Inheritance
TriggerContext
Implements
Inherited Members
Extension Methods

Properties

EntryStepsStarted

Set by the engine once TriggerAsync(ITriggerContext, CancellationToken) has dispatched or skipped at least one entry step — from then on the run is alive (recovery re-dispatches it) even if the trigger call later throws.

[IgnoreDataMember]
[JsonIgnore]
public bool EntryStepsStarted { get; set; }

Property Value

bool

Remarks

A caller that sees TriggerAsync throw while this is still false knows no work was started for the delivery, so letting the sender retry it cannot duplicate a run. The webhook endpoint uses it to decide whether to release the delivery's replay-protection key. The default implementation does not store the value (it always reads false); TriggerContext does.

Flow

The flow definition being triggered.

[IgnoreDataMember]
public IFlowDefinition Flow { get; set; }

Property Value

IFlowDefinition

Remarks

Marked IgnoreDataMemberAttribute so Newtonsoft.Json (Hangfire's job serialiser) neither writes nor reads it. FlowOrchestrator 1.17 – 1.34.x enqueued Hangfire step jobs with this context as an argument, so those payloads embed the whole flow manifest, whose RunAfterCondition values Newtonsoft can no longer read since Core dropped its Newtonsoft converter. The step-job overload resolves the flow from FlowRegistry by id and never reads this property, so skipping it keeps those queued jobs runnable on 2.0. System.Text.Json ignores the attribute.

JobId

Runtime-specific job or message identifier for the current execution unit (Hangfire job ID, queue message ID, etc.). Set by the runtime adapter before invoking the engine. Stored on the run and step records for correlation with the runtime's own dashboard.

public string? JobId { get; set; }

Property Value

string

PrincipalId

Identity of the caller that triggered the run, or null if anonymous. Sourced from the authentication principal at trigger time.

public string? PrincipalId { get; set; }

Property Value

string

RunId

Unique identifier for this flow run, generated at trigger time.

public Guid RunId { get; set; }

Property Value

Guid

SourceRunId

Optional lineage pointer — when set, persisted on the new run as SourceRunId so the dashboard can render a link back to the original. Used by "Re-run all".

public Guid? SourceRunId { get; set; }

Property Value

Guid?

Trigger

The trigger event that fired (key, type, payload, headers).

public ITrigger Trigger { get; set; }

Property Value

ITrigger

TriggerData

Deserialized body of the trigger payload (e.g. the webhook request body or manual trigger data). Available to steps via @triggerBody() expressions.

public object? TriggerData { get; set; }

Property Value

object

TriggerHeaders

HTTP headers from the inbound trigger request, or null for non-HTTP triggers. Available to steps via @triggerHeaders() expressions.

public IReadOnlyDictionary<string, string>? TriggerHeaders { get; set; }

Property Value

IReadOnlyDictionary<string, string>