Class FlowTriggerResult
- Namespace
- FlowOrchestrator.Core.Execution
- Assembly
- FlowOrchestrator.Core.dll
Outcome of TriggerAsync(ITriggerContext, CancellationToken).
public sealed record FlowTriggerResult : IEquatable<FlowTriggerResult>
- Inheritance
-
FlowTriggerResult
- Implements
- Inherited Members
Remarks
This replaces the anonymous objects the engine used to return through its object? contract.
The signature is unchanged, so nothing breaks, but callers can now actually read the outcome —
which matters because the two facts it carries are exactly the ones a caller must not assume.
Every trigger entry point is required to honour Disabled. Reporting a caller-side run id without checking it hands back an identifier that no run backs: a subsequent read of that run 404s, and the caller believes a disabled flow executed. The engine's own gate is not enough on its own, because it can only refuse to do work — it cannot stop a caller from inventing a run id and reporting success.
The JsonPropertyNameAttribute attributes are not decoration. The anonymous objects this
replaced serialised as runId / disabled / duplicate, and anything that wrote
the engine's return value straight onto the wire depended on that casing. Pinning the names keeps
those payloads byte-identical, so introducing the type is not a breaking change for them.
Constructors
FlowTriggerResult(Guid?, bool, bool)
Outcome of TriggerAsync(ITriggerContext, CancellationToken).
public FlowTriggerResult(Guid? RunId, bool Disabled = false, bool Duplicate = false)
Parameters
RunIdGuid?The run that was started, or null when no run was created because the flow is disabled.
Disabledbooltrue when the trigger was silently dropped because the flow is disabled. No run exists and
RunIdis null.Duplicatebooltrue when an idempotency key matched an earlier trigger, in which case
RunIdis the run that already exists rather than a new one.
Remarks
This replaces the anonymous objects the engine used to return through its object? contract.
The signature is unchanged, so nothing breaks, but callers can now actually read the outcome —
which matters because the two facts it carries are exactly the ones a caller must not assume.
Every trigger entry point is required to honour Disabled. Reporting a caller-side run id without checking it hands back an identifier that no run backs: a subsequent read of that run 404s, and the caller believes a disabled flow executed. The engine's own gate is not enough on its own, because it can only refuse to do work — it cannot stop a caller from inventing a run id and reporting success.
The JsonPropertyNameAttribute attributes are not decoration. The anonymous objects this
replaced serialised as runId / disabled / duplicate, and anything that wrote
the engine's return value straight onto the wire depended on that casing. Pinning the names keeps
those payloads byte-identical, so introducing the type is not a breaking change for them.
Properties
Disabled
true when the trigger was silently dropped because the flow is disabled. No run
exists and RunId is null.
[JsonPropertyName("disabled")]
public bool Disabled { get; init; }
Property Value
Duplicate
true when an idempotency key matched an earlier trigger, in which case
RunId is the run that already exists rather than a new one.
[JsonPropertyName("duplicate")]
public bool Duplicate { get; init; }
Property Value
RunId
The run that was started, or null when no run was created because the flow is disabled.
[JsonPropertyName("runId")]
public Guid? RunId { get; init; }
Property Value
- Guid?