elsa-core
elsa-core copied to clipboard
Use the REST API
I created an http request endpoint through the workflow designer. If I call the path configured in the trigger, the status of the workflow is normal at this time. But if I use rest api to request, the corresponding http endpoint status will always stay in running. How can I make it normal like the previous one?
To address the issue you're experiencing with the HTTP endpoint status staying in "running" when using the REST API to request, you should consider the following:
-
Ensure that the HTTP Endpoint activity is configured with the
CanStartWorkflowproperty set totrue. This allows the workflow to be triggered by an HTTP request. -
Verify that the workflow is published. Unpublished workflows cannot be triggered.
-
If you are using the REST API to trigger the workflow, make sure you are using the correct endpoint and providing any necessary input data. For synchronous execution, use the
/workflow-definitions/{workflow_definition_id}/executeendpoint. -
Check if the workflow is designed to complete or suspend after the HTTP Endpoint activity. If the workflow is expected to suspend, it will remain in a running state until it is resumed.
-
If the workflow is supposed to write an HTTP response and then complete, ensure that the
WriteHttpResponseactivity is configured correctly and that it is being reached and executed. -
If you are using the REST API to resume a workflow, ensure that you are using the correct endpoint and providing the necessary correlation or workflow instance ID.
-
Review the logs for any errors or issues that might be preventing the workflow from completing.
-
If you have recently updated Elsa, ensure that you are using the latest packages as there may have been bug fixes related to your issue.
If you continue to experience issues, please provide more detailed information about your workflow configuration, the exact REST API calls you are making, and any error messages or logs you are seeing. This will help in diagnosing the problem more effectively.