workflow-core
workflow-core copied to clipboard
How to get step errors using SQL provider
I'm building a workflow host with GraphQL webapi on top to be able to start/stop and get status of running workflows. I want to display errors and other information on the workflows and steps.
How do you access step error / execution errors using the SQL provider? Cant seem to find any methods for that.
There are none. I had to reimplement the Npgsql persistence interface to have a DbContext to freely use and access data.
You can get the DbContext like this:
builder.Services.AddScoped<IWorkflowDbContextFactory, SqlContextFactory>(sp => new SqlContextFactory(@"Data Source=.\SQLEXPRESS;Initial Catalog=WorkflowCore;Integrated Security=true;Encrypt=false", null));
var app = builder.Build();
app.MapPost("/workflows/search", async ([FromServices] IWorkflowDbContextFactory workflowDb, [FromBody] WorkflowQuery query, CancellationToken cancellationToken) =>
{
var db = workflowDb.Build();
var workflows = db.Set<PersistedWorkflow>().AsQueryable();
Thx. I'll have a look into it. Had hoped that there be supported handles for this. Maybe in later versions