You can execute any workflow via the REST API, even workflows created in code or using JSON.
However, these workflows need to be available from the workflow registry.
If your JSON workflows are provided via a workflow provider (any IWorkflowProvider
implementation like BlobStorageWorkflowProvider
), then they will be part of the workflow registry.
For example, if you store workflow JSON files in your application in a folder called workflows
, you can configure the blob storage provider like this:
// Configure blob storage for blob storage workflow storage provider.
services.Configure<BlobStorageWorkflowProviderOptions>(options => options.BlobStorageFactory = () => StorageFactory.Blobs.DirectoryFiles(Path.Combine(_environment.ContentRootPath, "Workflows")));
You can find the sample application here: https://github.com/elsa-workflows/elsa-core/tree/master/src/samples/aspnet/Elsa.Samples.SignalApi