Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workflow stuck in suspended state #4895

Open
kkagarwal2002 opened this issue Feb 7, 2024 · 3 comments
Open

Workflow stuck in suspended state #4895

kkagarwal2002 opened this issue Feb 7, 2024 · 3 comments
Labels
wontfix This will not be worked on

Comments

@kkagarwal2002
Copy link

kkagarwal2002 commented Feb 7, 2024

I created a workflow in the designer where HTTP Request and HTTP Response activity used. If I run workflow where I have one HTTP Request and one HTTP Response activity in flow, then it works fine but as soon as I have few more HTTP Request added then it always suspends at the HTTP Response activity.

Could you please help me on this? Please let me know if you need more information from my side.

Copy link

glime-ai bot commented Feb 7, 2024

Based on the context provided, it seems like you are encountering an issue where adding multiple HTTP Request activities in your workflow causes the workflow to suspend at the HTTP Response activity. This behavior could be related to a known issue with handling multiple asynchronous HTTP calls within Elsa workflows, as indicated in the GitHub issue #4737 and #4763.

The issue described in #4737 was initially fixed, but a follow-up problem was reported in #4763 indicating that the next activity after multiple asynchronous HTTP calls never gets executed, and the HttpRequest (Flow) activity still has the suspension problem.

To address this issue, you should first ensure that you are using the latest version of Elsa, as updates and bug fixes are regularly released. If you are already on the latest version and the problem persists, you may want to follow the progress of the issue on the GitHub repository or reach out to the maintainers for further assistance.

In the meantime, you can try the following steps as a workaround:

  1. Review the workflow JSON file to ensure that the HTTP Request activities are configured correctly and that they are not causing the workflow to suspend due to misconfiguration.
  2. Check if there are any specific error messages or logs that can provide more insight into why the workflow is suspending.
  3. Consider restructuring the workflow to handle HTTP requests sequentially or using a different pattern that may avoid the suspension issue.

If you provide the JSON file of the workflow, I could give more specific advice on potential issues within the workflow definition.

For further assistance, you may also want to consult the Elsa documentation or seek help from the community on the Elsa GitHub repository or discussion forums.

@kkagarwal2002
Copy link
Author

I am using Elsa server 3.04 which already has a fix mentioned above. Below is Json workflow file for your reference:
workflow-4.json

Below is screenshot of the workflow where it goes to suspended state:
Screenshot 2024-02-07 183039

@sfmskywalker
Copy link
Member

Hi @kkagarwal2002

The reason that the HTTP Response activity remains in the Suspended state is because there is no HTTP Context at that point - this is because of the way that the Delay activity works, which will first put the workflow instance to sleep and removed from memory. Then once the specified delay has passed, the workflow is resumed, but this happens from a background job - at which point there's no HTTP Context anymore.

When there's no HTTP Context, the HTTP Response assumes that it will be resumed by the host application once the workflow can be resumed from within an HTTP Context - but this would be up to the application and cannot be handled automatically.

To "fix" your workflow, you would need to basically remove the Delay activity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants