elsa-workflows / elsa-core

A .NET workflows library
https://v3.elsaworkflows.io/
MIT License
5.87k stars 1.06k forks source link

Timer and Delay cannot run properly #5228

Open 493141993 opened 4 weeks ago

493141993 commented 4 weeks ago
  1. After the publish of "Timer", instances will not be scheduled to start, and will be triggered about 5 times after each service restart.
  2. After the "Delay" waiting time is reached, the status remains as Running and will not proceed to the next step. The above two questions were good when I started using them, but I don't know what happened, which led to this. Can anyone help me?
glime-ai[bot] commented 4 weeks ago

To address your concerns regarding the "Timer" and "Delay" activities within Elsa workflows, let's consider each issue separately:

  1. Timer Activity Not Scheduling Instances to Start: The Timer activity in Elsa is designed to act as a trigger when used as a start activity. If it's not behaving as expected, it could be due to several reasons, such as misconfiguration of the cron expression, issues with the hosting environment (like IIS stopping the process due to inactivity), or a bug within Elsa itself. To troubleshoot, you can check the cron expression for correctness, ensure that the hosting environment is configured to keep the process alive, and look for any relevant issues or updates in the Elsa GitHub repository.

  2. Delay Activity Not Proceeding to Next Step: The Delay activity should pause the workflow for a specified duration and then continue to the next step. If the workflow remains in a "Running" state and does not proceed, it could be due to a blocking issue within the workflow, a problem with the workflow's design, or a bug. To resolve this, you can review the workflow design to ensure that there are no logical errors, check for any exceptions or errors in the logs, and consult the Elsa GitHub issues for similar problems reported by other users.

For both issues, it's also important to ensure that you are using the latest stable version of Elsa, as updates often include bug fixes and improvements. If the problems persist, you can seek further assistance by creating an issue in the Elsa GitHub repository with detailed information about your workflow and the problems you're encountering.

This comment was generated by Glime.

sfmskywalker commented 4 weeks ago

Hi @493141993 , can you tell a little bit more about your setup?

493141993 commented 3 weeks ago

Elsa version 3.1.2 Not using Quartz NET, Hangfire Today I restarted the service again and it can run normally without any changes

493141993 commented 3 weeks ago

20240417181705 Set a wait time of 1 second, but it has been 6 minutes before proceeding to the next step

ichibisov commented 2 weeks ago

I can confirm there is something wrong with scheduling for Timer and Cron activities. Version 3.1.2 with default Timer. Elsa can create extra instances of the workflow. I think it is related to publishing new versions. You can create a workflow just with the timer, set time T1, publish, set the time to T2 and publish. It seems it triggers for T1 and T2. Restart the service helps.

ichibisov commented 2 weeks ago

Unpublishing and then publishing without restart keep incorrect behavior