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
foundryExecutionIdGuidThe foundry execution identifier.
workflowIdGuidThe workflow identifier.
cancellationTokenCancellationTokenA token to observe while waiting for the task to complete.
Returns
SaveAsync(WorkflowExecutionSnapshot, CancellationToken)
Saves a snapshot representing the current workflow execution state.
Task SaveAsync(WorkflowExecutionSnapshot snapshot, CancellationToken cancellationToken = default)
Parameters
snapshotWorkflowExecutionSnapshotThe execution snapshot to save.
cancellationTokenCancellationTokenA token to observe while waiting for the task to complete.
Returns
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
foundryExecutionIdGuidThe foundry execution identifier.
workflowIdGuidThe workflow identifier.
cancellationTokenCancellationTokenA token to observe while waiting for the task to complete.
Returns
- Task<WorkflowExecutionSnapshot>
The snapshot if found; otherwise, null.