Table of Contents

Interface IFlowRunControlStore

Namespace
FlowOrchestrator.Core.Storage
Assembly
FlowOrchestrator.Core.dll

Persistence contract for run-level control signals: cancellation, timeout, and idempotency. Decoupled from IFlowRunStore so control records can be written before the run is committed.

public interface IFlowRunControlStore

Methods

ConfigureRunAsync(Guid, Guid, string, string?, DateTimeOffset?)

Persists the control record for a new run, including an optional idempotency key and an absolute timeout deadline.

Task ConfigureRunAsync(Guid runId, Guid flowId, string triggerKey, string? idempotencyKey, DateTimeOffset? timeoutAtUtc)

Parameters

runId Guid
flowId Guid
triggerKey string
idempotencyKey string
timeoutAtUtc DateTimeOffset?

Returns

Task

FindRunIdByIdempotencyKeyAsync(Guid, string, string)

Looks up an existing run that was started with the given idempotency key. Returns the RunId of the existing run, or null if none exists.

Task<Guid?> FindRunIdByIdempotencyKeyAsync(Guid flowId, string triggerKey, string idempotencyKey)

Parameters

flowId Guid
triggerKey string
idempotencyKey string

Returns

Task<Guid?>

GetRunControlAsync(Guid)

Returns the control record for the given run, or null if not found.

Task<FlowRunControlRecord?> GetRunControlAsync(Guid runId)

Parameters

runId Guid

Returns

Task<FlowRunControlRecord>

MarkTimedOutAsync(Guid, string?)

Marks the run as timed out. Called by the timeout-enforcement background service.

Task<bool> MarkTimedOutAsync(Guid runId, string? reason)

Parameters

runId Guid
reason string

Returns

Task<bool>

true if the record was found and updated; false otherwise.

RequestCancelAsync(Guid, string?)

Marks a cancellation request for the run. Steps check this flag before executing.

Task<bool> RequestCancelAsync(Guid runId, string? reason)

Parameters

runId Guid
reason string

Returns

Task<bool>

true if the record was found and updated; false otherwise.

TryRegisterIdempotencyKeyAsync(Guid, string, string, Guid)

Atomically registers an idempotency key for the given run.

Task<bool> TryRegisterIdempotencyKeyAsync(Guid flowId, string triggerKey, string idempotencyKey, Guid runId)

Parameters

flowId Guid
triggerKey string
idempotencyKey string
runId Guid

Returns

Task<bool>

true if the key was registered by this call; false if a record with this key already existed (duplicate trigger).