Search code examples
workflow

How do I display the result of a SendHTTRequest Activity?


I have a SendHTTPRequest activity in an Elsa Workflow and it executes correctly, but the response doesn't get displayed even though I selected Read Content. The page is still empty. Why isn't it showing the result?


Solution

  • There isn't any documentation on SendHTTPRequest but after looking at the source code and some trial and error, I was able to get the response to show by adding a WriteHTTPResponse after the SendHTTPRequest. The SendHTTPRequest also needed some additional configuration:

    • Add values in the Supported Status Codes section. This creates the different flow paths after execution.
    • Give it a Name (e.g. GetHTTP) so you can get access to the response in WriteHTTPResponse.

    Now drag the status code path to WriteHTTPRequest so it will execute that activity on a 200. In the Content section you can then use an expression to output the response.

    E.g. GetHTTP.Response.Content and select JavaScript from the dropdown.

    enter image description here