Skip to content

IWorkflowCheckpointStore

Namespace AgentPrism · Assembly AgentPrism.Abstractions.dll

The store for workflow checkpoints.

public interface IWorkflowCheckpointStore

The contract deliberately carries no Microsoft Agent Framework type: the state is expressed as a JsonElement. This way, AgentPrism.PostgreSql stores checkpoints without binding to the workflow engine’s 130-type API surface. Adapting to MAF’s ICheckpointStore<JsonElement> interface happens inside AgentPrism.Workflows.

Every read is scoped by the tenant filter. A checkpoint carries the entire execution state; another tenant’s checkpoint returns not found — not even “unauthorized” is said, its existence is not leaked.

CreateAsync(WorkflowCheckpointRecord, CancellationToken)

Section titled “ CreateAsync(WorkflowCheckpointRecord, CancellationToken)”

Writes a new checkpoint.

ValueTask<WorkflowCheckpointRecord> CreateAsync(WorkflowCheckpointRecord record, CancellationToken cancellationToken = default)

record WorkflowCheckpointRecord

The record to write.

cancellationToken CancellationToken

The cancellation token.

ValueTask<WorkflowCheckpointRecord>

The written record.

DeleteAsync(string, string, CancellationToken)

Section titled “ DeleteAsync(string, string, CancellationToken)”

Deletes all of a session’s checkpoints.

ValueTask<int> DeleteAsync(string tenantId, string sessionId, CancellationToken cancellationToken = default)

tenantId string

The tenant identifier.

sessionId string

The execution session identifier.

cancellationToken CancellationToken

The cancellation token.

ValueTask<int>

The number of records deleted.

ListAsync(string, string, CancellationToken)

Section titled “ ListAsync(string, string, CancellationToken)”

Lists a session’s checkpoints, oldest to newest. The state payload is not read; only metadata is returned.

ValueTask<IReadOnlyList<WorkflowCheckpointRecord>> ListAsync(string tenantId, string sessionId, CancellationToken cancellationToken = default)

tenantId string

The tenant identifier.

sessionId string

The execution session identifier.

cancellationToken CancellationToken

The cancellation token.

ValueTask<IReadOnlyList<WorkflowCheckpointRecord>>

The records.

ListByRunAsync(string, Guid, CancellationToken)

Section titled “ ListByRunAsync(string, Guid, CancellationToken)”

Lists the checkpoints a single run produced, oldest to newest. The state payload is not read.

ValueTask<IReadOnlyList<WorkflowCheckpointRecord>> ListByRunAsync(string tenantId, Guid runId, CancellationToken cancellationToken = default)

tenantId string

The tenant identifier.

runId Guid

The run identifier.

cancellationToken CancellationToken

The cancellation token.

ValueTask<IReadOnlyList<WorkflowCheckpointRecord>>

The records.

Separate from the session-based list: a session can carry multiple runs (resuming opens a new run each time), and the UI asks “where can this run be resumed from.”

ReadAsync(string, string, string, CancellationToken)

Section titled “ ReadAsync(string, string, string, CancellationToken)”

Reads a single checkpoint’s state.

ValueTask<JsonElement?> ReadAsync(string tenantId, string sessionId, string checkpointId, CancellationToken cancellationToken = default)

tenantId string

The tenant identifier.

sessionId string

The execution session identifier.

checkpointId string

The checkpoint identifier.

cancellationToken CancellationToken

The cancellation token.

ValueTask<JsonElement?>

The opaque state; null if the record does not exist or belongs to another tenant.