elsa-core icon indicating copy to clipboard operation
elsa-core copied to clipboard

Next Activity Found But Not Scheduled After Resume [Elsa 3.1.2]

Open iamyokai opened this issue 9 months ago • 2 comments

As shown in screenshot captured below, the activity "In Use" resumed and completed and the next child activity was found but the activity not scheduled and the workflow was stuck in Suspended. I have encountered this a few times along the way specifically in looping scenarios. Initially it happened within a straightforward workflow and now within While activity.

image

image

workflow.json

workflow instance data.json

iamyokai avatar Apr 30 '24 04:04 iamyokai

To address the issue where the workflow gets stuck in a Suspended state during looping scenarios, it's important to consider several factors that could be contributing to this behavior. Here are some steps and considerations that might help resolve the issue:

  1. Check Workflow Design: Ensure that the workflow is designed correctly, especially the loop configuration. Make sure that the loop has a proper exit condition and that activities within the loop are configured correctly.

  2. Review Activity Implementation: If you are using custom activities within the loop, review their implementation to ensure they are not causing the workflow to suspend unexpectedly.

  3. Concurrency Issues: If the workflow involves parallel processing or multiple instances running concurrently, ensure that there are no race conditions or deadlocks occurring.

  4. Workflow Version: Make sure you are using the latest version of Elsa, as bugs and issues are regularly fixed in newer releases.

  5. Check for Known Issues: Review the known issues and limitations of Elsa, as listed in the documentation and on the GitHub issues page, to see if this is a recognized problem with a suggested workaround or pending fix.

  6. Debugging: Use the available debugging tools and logs to trace the workflow execution and identify where it gets suspended. Check for any exceptions or errors that might be occurring.

  7. Consult the Community: If the issue persists, consider reaching out to the Elsa community on forums like Stack Overflow or the Elsa GitHub repository issues section. Provide them with the workflow design and any relevant logs or error messages.

  8. Workflow Instance Data: Review the workflow instance data to check for any anomalies or unexpected values that could be causing the workflow to suspend.

Given the context provided, it seems like this issue might be related to the way looping is handled within Elsa workflows. It could be beneficial to look into similar issues reported by other users on the Elsa GitHub issues page or Stack Overflow to see if there are any common patterns or solutions.

If you can provide more specific details about the workflow activities inside the loop and the conditions that lead to the suspension, it would be easier to give a more precise answer.

This comment was generated by Glime.

glime-ai[bot] avatar Apr 30 '24 04:04 glime-ai[bot]

Your problem is the same as mine. I hope that after resuming the activity, it can automatically proceed. But at present, it seems to be stuck at the node where it was resumed.

https://github.com/elsa-workflows/elsa-core/issues/5281

zdydev avatar Apr 30 '24 09:04 zdydev

Hello , you can unblock using a join activity just before preparing.

jdevillard avatar May 06 '24 13:05 jdevillard

It seems that adding a Join activity does seems to resolve my issue.

image

My activity is modelled after the Decision flow node activity, the outcome is either Forward or Backward depending on the configured action and result.

  • Is it intended that Join activity will always be required when either route converge at a later stage?
  • In my scenario, the activity In Use actually unblock when resumed, so it seems the converge actually causes the workflow itself to block instead?

Edit: After re-reading Implicit Join & Fork of https://sipkeschoorstra.medium.com/elsa-3-0-2b341e7cbfa7, I think the Join is required after all.

iamyokai avatar May 07 '24 02:05 iamyokai

Redesigned the workflow back to my original one, adding Join activities where there's convergence of routes, and it is now working as intended. I shall close this issue. Thanks for the help!

iamyokai avatar May 07 '24 10:05 iamyokai