Skip to content

IWorkflowDefinitionStore

Namespace AgentPrism · Assembly AgentPrism.Abstractions.dll

The store for workflow definitions stored in the database.

public interface IWorkflowDefinitionStore

Unlike agent definitions, no version history is kept. A workflow definition carries only a name list and a pattern; the information needed to roll back already exists in the audit trail (IAuditLog). An agent definition, on the other hand, carries instruction text, and the old form of that text cannot be reconstructed anywhere else.

DeleteAsync(string, string, CancellationToken)

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

Deletes the definition.

ValueTask<bool> DeleteAsync(string tenantId, string name, CancellationToken cancellationToken = default)

tenantId string

The tenant identifier.

name string

The workflow name.

cancellationToken CancellationToken

The cancellation token.

ValueTask<bool>

true if the delete happened.

GetAsync(string, string, CancellationToken)

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

Fetches the definition with the given name.

ValueTask<WorkflowDefinition?> GetAsync(string tenantId, string name, CancellationToken cancellationToken = default)

tenantId string

The tenant identifier.

name string

The workflow name.

cancellationToken CancellationToken

The cancellation token.

ValueTask<WorkflowDefinition?>

The definition; null if it does not exist.

Lists all of a tenant’s definitions, by name.

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

tenantId string

The tenant identifier.

cancellationToken CancellationToken

The cancellation token.

ValueTask<IReadOnlyList<WorkflowDefinition>>

The definitions.

SaveAsync(string, WorkflowDefinition, CancellationToken)

Section titled “ SaveAsync(string, WorkflowDefinition, CancellationToken)”

Saves the definition. The incoming WorkflowDefinition.Version value is ignored; the store determines the version number.

ValueTask<WorkflowDefinition> SaveAsync(string tenantId, WorkflowDefinition definition, CancellationToken cancellationToken = default)

tenantId string

The tenant identifier.

definition WorkflowDefinition

The definition to save.

cancellationToken CancellationToken

The cancellation token.

ValueTask<WorkflowDefinition>

The definition with its version number assigned.