You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TLDR : We should offer a simple way to let the workflow write to the http response directly and perhaps resume asynchronously
After doing some test on HttpEndpoint Activity and WriteHttpResponse, here are my observations :
Elsa.Http.Middleware.WorkflowMiddleware is responsible to :
react to the Http Input (Path etc..)
found the Workflow to instanciate,
execute the Workflow Instance
Respond to the caller (return in the middleware)
WriteHttpResponse modify the HttpContext to allow the wokflow to customise the Response of the workflow
BUT even if we use the WriteHttpResponse at the begining of the workflow , the call to ExecuteWorkflowAsync is blocked and will be unblock only if workflow is suspended / finished.
So for example, a simple workflow HttpEndpoint -> HttpWriteResponse -> Delay 5Sec (blocking, without suspend state) , the response is received by the client at the end of the workflow so 5sec after the HttpWriteResponse.
Technically , this behavior can also lead to performance issue, due to any backend work that can be done by the framework (persistence etc...)
Another functional example is, HttpEndpoint -> doing some verification -> HttpWriteResponse (ok) -> doing some other work -> put the workflow in error state du to second step work issue. In this case, the Http Client receive a 500 error which is not necessary what we want.
The text was updated successfully, but these errors were encountered:
TLDR : We should offer a simple way to let the workflow write to the http response directly and perhaps resume asynchronously
After doing some test on HttpEndpoint Activity and WriteHttpResponse, here are my observations :
BUT even if we use the WriteHttpResponse at the begining of the workflow , the call to ExecuteWorkflowAsync is blocked and will be unblock only if workflow is suspended / finished.
So for example, a simple workflow HttpEndpoint -> HttpWriteResponse -> Delay 5Sec (blocking, without suspend state) , the response is received by the client at the end of the workflow so 5sec after the HttpWriteResponse.
Technically , this behavior can also lead to performance issue, due to any backend work that can be done by the framework (persistence etc...)
Another functional example is, HttpEndpoint -> doing some verification -> HttpWriteResponse (ok) -> doing some other work -> put the workflow in error state du to second step work issue. In this case, the Http Client receive a 500 error which is not necessary what we want.
The text was updated successfully, but these errors were encountered: