Table of Contents

Interface IWorkflowPersistenceProvider

Namespace
WorkflowForge.Extensions.Persistence.Abstractions
Assembly
WorkflowForge.Extensions.Persistence.dll

Abstraction for persisting and restoring workflow execution state. Implementations are provided by consumers to integrate with their chosen storage.

public interface IWorkflowPersistenceProvider

Methods

DeleteAsync(Guid, Guid, CancellationToken)

Deletes a previously saved snapshot for the given execution and workflow IDs. Implementations may choose to ignore when not found.

Task DeleteAsync(Guid foundryExecutionId, Guid workflowId, CancellationToken cancellationToken = default)

Parameters

foundryExecutionId Guid

The foundry execution identifier.

workflowId Guid

The workflow identifier.

cancellationToken CancellationToken

A token to observe while waiting for the task to complete.

Returns

Task

SaveAsync(WorkflowExecutionSnapshot, CancellationToken)

Saves a snapshot representing the current workflow execution state.

Task SaveAsync(WorkflowExecutionSnapshot snapshot, CancellationToken cancellationToken = default)

Parameters

snapshot WorkflowExecutionSnapshot

The execution snapshot to save.

cancellationToken CancellationToken

A token to observe while waiting for the task to complete.

Returns

Task

TryLoadAsync(Guid, Guid, CancellationToken)

Attempts to load a previously saved snapshot for the given execution and workflow IDs. Returns null if no snapshot is available.

Task<WorkflowExecutionSnapshot?> TryLoadAsync(Guid foundryExecutionId, Guid workflowId, CancellationToken cancellationToken = default)

Parameters

foundryExecutionId Guid

The foundry execution identifier.

workflowId Guid

The workflow identifier.

cancellationToken CancellationToken

A token to observe while waiting for the task to complete.

Returns

Task<WorkflowExecutionSnapshot>

The snapshot if found; otherwise, null.