ELSA 3.0 - Invoking manually registered workflows using the IWorkflowRuntime service

483 Views Asked by At

I've created and registered a workflow as described here.

class DailyReport : WorkflowBase { ... }

services.AddElsa(elsa => elsa.AddWorkflow<DailyReport>());

If I start it using IWorkflowRuntime, I get the "Specified workflow definition and version does not exist" exception.

var runtime = serviceProvider.GetRequiredService<IWorkflowRuntime>();

var result = await runtime.StartWorkflowAsync("DailyReport");

If I run the workflow using IWorkflowRunner, it runs just fine.

var runner = serviceProvider.GetRequiredService<IWorkflowRunner>();

var result = await runner.RunAsync(new DailyReport());

What am I missing here?

0

There are 0 best solutions below