Table of Contents

Class EfWorkflowHistoryGraphStore

Namespace
JD.AI.Workflows.History
Assembly
JD.AI.Workflows.dll

EF Core implementation of IWorkflowHistoryGraphStore that persists workflow history graph nodes and edges to an SQLite database. Uses WorkflowHistoryDbContext which maps to the same tables created by the WorkflowFramework Dashboard migration (AddWorkflowHistoryGraph).

public sealed class EfWorkflowHistoryGraphStore : IWorkflowHistoryGraphStore
Inheritance
EfWorkflowHistoryGraphStore
Implements
Inherited Members

Constructors

EfWorkflowHistoryGraphStore(WorkflowHistoryDbContext)

public EfWorkflowHistoryGraphStore(WorkflowHistoryDbContext db)

Parameters

db WorkflowHistoryDbContext

Methods

GetEdgesForWorkflowAsync(string, CancellationToken)

public Task<IReadOnlyList<WorkflowHistoryEdge>> GetEdgesForWorkflowAsync(string workflowName, CancellationToken ct = default)

Parameters

workflowName string
ct CancellationToken

Returns

Task<IReadOnlyList<WorkflowHistoryEdge>>

GetNodeAsync(string, CancellationToken)

public Task<WorkflowHistoryNode?> GetNodeAsync(string fingerprint, CancellationToken ct = default)

Parameters

fingerprint string
ct CancellationToken

Returns

Task<WorkflowHistoryNode>

GetTopEdgesFromAsync(string, int, CancellationToken)

public Task<IReadOnlyList<WorkflowHistoryEdge>> GetTopEdgesFromAsync(string fingerprint, int topN = 10, CancellationToken ct = default)

Parameters

fingerprint string
topN int
ct CancellationToken

Returns

Task<IReadOnlyList<WorkflowHistoryEdge>>

LoadAsync(CancellationToken)

public Task<WorkflowHistoryGraph> LoadAsync(CancellationToken ct = default)

Parameters

ct CancellationToken

Returns

Task<WorkflowHistoryGraph>

SaveAsync(WorkflowHistoryGraph, CancellationToken)

public Task SaveAsync(WorkflowHistoryGraph graph, CancellationToken ct = default)

Parameters

graph WorkflowHistoryGraph
ct CancellationToken

Returns

Task

SearchNodesAsync(string, int, CancellationToken)

public Task<IReadOnlyList<WorkflowHistoryNode>> SearchNodesAsync(string query, int limit = 20, CancellationToken ct = default)

Parameters

query string
limit int
ct CancellationToken

Returns

Task<IReadOnlyList<WorkflowHistoryNode>>

UpsertEdgeAsync(WorkflowHistoryEdge, CancellationToken)

public Task UpsertEdgeAsync(WorkflowHistoryEdge edge, CancellationToken ct = default)

Parameters

edge WorkflowHistoryEdge
ct CancellationToken

Returns

Task

UpsertNodeAsync(WorkflowHistoryNode, CancellationToken)

public Task UpsertNodeAsync(WorkflowHistoryNode node, CancellationToken ct = default)

Parameters

node WorkflowHistoryNode
ct CancellationToken

Returns

Task