elsa-workflows / elsa-workflows/elsa-core
Elsa Internal Scheduling triggers multiple times
- Dominant language
- C#
- Stars
- 7.9k
- Forks
- 1.5k
- Avg merge
- 15h 22m
- Merged PRs (30d)
- 114
Description
## Description
Using the internal scheduling of ELSA v3.5.3, there are multiple Jobs in my instance, wich should run once a day at a certain time, triggered twice.
SHOULD BE:
The cron definition "0 30 5 * * ?" should trigger at 5:30AM every day
ACTUAL BEHAVIOR:
The mentioned cron definition ist triggered at at 5:29AM and again at at 5:30AM every day
Even deleting these workflow definitions and restarting IIS which creates the definitions, doesn't help
Code Example which defines such a workflow:
```
using Elsa.Workflows;
using Elsa.Workflows.Activities;
using Elsa.Workflows.Models;
using Elsa.Workflows.Runtime.ActivationValidators;
public class MyJobWorkflow(IConfiguration configuration) : WorkflowBase
{
protected override void Build(IWorkflowBuilder builder)
{
builder.Name = "My Job Workflow";
builder.Description = "My Job Workflow Description";
builder.DefinitionId = "WorkflowDefinitionId";
builder.WithActivationStrategyType();
builder.Root = new Sequence
{
Activities =
{
new Elsa.Scheduling.Activities.Cron
{
CanStartWorkflow = true,
CronExpression = new Input(
configuration.GetValue("Elsa:MyJobWorkflow:Interval")! // FROM appsettings.json
)
},
new MyActivity()
}
};
}
}
```
Contributor guide
Research direction
Start by reproducing the issue with Elsa.Scheduling.Activities.Cron, the expression "0 30 5 * * ?", and the workflow definition shown in the report. Inspect the internal scheduling path used by the Cron activity and compare the 5:29AM and 5:30AM triggers. Done means the expression starts the workflow once at 5:30AM each day, including after the definitions are recreated and IIS is restarted.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100