Table of Contents

Class PostgreSqlFlowSignalStore

Namespace
FlowOrchestrator.PostgreSQL
Assembly
FlowOrchestrator.PostgreSQL.dll

Dapper-based PostgreSQL implementation of IFlowSignalStore. Persists waiters in the flow_signal_waiters table created by PostgreSqlFlowOrchestratorMigrator.

public sealed class PostgreSqlFlowSignalStore : IFlowSignalStore
Inheritance
PostgreSqlFlowSignalStore
Implements
Inherited Members

Constructors

PostgreSqlFlowSignalStore(string)

public PostgreSqlFlowSignalStore(string connectionString)

Parameters

connectionString string

Methods

DeliverSignalAsync(Guid, string, string, CancellationToken)

Atomically attempts to deliver a payload to the waiter matching (runId, signalName).

public ValueTask<SignalDeliveryResult> DeliverSignalAsync(Guid runId, string signalName, string payloadJson, CancellationToken ct = default)

Parameters

runId Guid

The run whose waiter should receive the payload.

signalName string

Signal name to look up.

payloadJson string

Pre-serialised JSON payload supplied by the caller.

ct CancellationToken

Cancellation token.

Returns

ValueTask<SignalDeliveryResult>

Delivered with the resolved StepKey on success; NotFound when no waiter matches; AlreadyDelivered when a payload is already recorded.

GetWaiterAsync(Guid, string, CancellationToken)

Returns the waiter for the given run + step key, or null if none is registered.

public ValueTask<FlowSignalWaiter?> GetWaiterAsync(Guid runId, string stepKey, CancellationToken ct = default)

Parameters

runId Guid
stepKey string
ct CancellationToken

Returns

ValueTask<FlowSignalWaiter>

RegisterWaiterAsync(Guid, string, string, DateTimeOffset?, CancellationToken)

Registers a new waiter for runId + stepKey. Idempotent — a duplicate register on the same key updates the signal name / expiry without resetting CreatedAt.

public ValueTask RegisterWaiterAsync(Guid runId, string stepKey, string signalName, DateTimeOffset? expiresAt, CancellationToken ct = default)

Parameters

runId Guid

The run that owns the parked step.

stepKey string

The step key as authored in the flow manifest.

signalName string

Logical signal name to address the waiter from the signal endpoint.

expiresAt DateTimeOffset?

Optional absolute deadline; null waits indefinitely.

ct CancellationToken

Cancellation token.

Returns

ValueTask

RemoveWaiterAsync(Guid, string, CancellationToken)

Removes the waiter row. Called by the handler when the wait is over (delivered, expired, or cancelled).

public ValueTask RemoveWaiterAsync(Guid runId, string stepKey, CancellationToken ct = default)

Parameters

runId Guid
stepKey string
ct CancellationToken

Returns

ValueTask