elsa-workflows / elsa-workflows/elsa-core
Code Workflow not showing up in Designer or in DB
- Dominant language
- C#
- Stars
- 7.9k
- Forks
- 1.5k
- Avg merge
- 15h 22m
- Merged PRs (30d)
- 114
Description
Hi there,
I need help with a simple issue I'm facing.
I'm using Elsa 3.3.5, with a MSSQLServer as db.
I've been developing my first code Workflow for over a month, I've been able to see it from the Dashboard normally and starting it using Elsa HTTP API.
Now I developed a second Workflow class, but it's not showing in the dashboard neither I'm able to start the worflow usinh HTTP API (keep getting 404 Not found error)
Workflows are all in the same namespace and are registered using:
````
services.AddElsa(elsa => elsa
.UseIdentity(identity =>
{
identity.TokenOptions = options => options.SigningKey = configuration.GetValue("ELSA_SIGNING_KEY");
identity.UseAdminUserProvider();
identity.UserProvider = (IServiceProvider sp) => sp.GetRequiredService();
identity.ApiKeyOptions = options =>
{
options.KeyName = "X-API-KEY"; // Default header name
options.SuppressWWWAuthenticateHeader = true;
options.IgnoreAuthenticationIfAllowAnonymous = true;
};
})
.UseDefaultAuthentication(config =>
{
config.UseApiKeyAuthorization();
})
.UseWorkflowManagement(management => management.UseEntityFrameworkCore(options =>
{
options.UseSqlServer(elsaConnectionString); // Ensure correct connection string
}))
.UseWorkflowRuntime(runtime => runtime.UseEntityFrameworkCore(options =>
{
options.UseSqlServer(elsaConnectionString); // Ensure correct connection string
}))
.UseScheduling()
.UseJavaScript()
.UseLiquid()
.UseCSharp()
.UseHttp(http => http.ConfigureHttpOptions = options => configuration.GetSection("ElsaServerHttp").Bind(options))
.UseWorkflowsApi()
.AddActivitiesFrom()
.AddWorkflowsFrom()
//.AddWorkflow()
.UseAzureServiceBus(sbConnectionString, option =>
{
option.CreateQueuesTopicsAndSubscriptions = true; // Ensure queues, topics, and subscriptions are created
option.ServiceBusClientFactory = (sp) =>
{
var serviceBusClientFactory = sp.GetRequiredService>();
return serviceBusClientFactory.CreateClient("AzSBusClient");
};
})
.UseFileStorage()
);
````
this is the test workflow I'm trying to register:
````
public class EPTestWorkflow : WorkflowBase
{
protected override void Build(IWorkflowBuilder builder)
{
builder.Root = new Sequence
{
Activities =
{
new WriteLine("Hello World!"),
}
};
}
}
````
Also in the DB table `[Elsa].[WorkflowDefinitions]` the workflow `EPTestWorkflow ` is not there.
Am I missing a step?
Do I need to programmatically do something to save the workflow definition into the db?
As said, the very first workflow I coded is still there, registered and working as expected, and I can see a record into `[Elsa].[WorkflowDefinitions]` for that.
Thanks in advance.
Emilio
Contributor guide
Assessment
This issue has not been assessed yet.