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

Http Flow

Open NoorsTah opened this issue 11 months ago • 2 comments

I am trying to make Http Post Endpoint With Body That i can reuse in my custom activity , there are no documentation about this type of flows , is this applicable ? and if it is what is the wrong about this image image

even when i try the designer part image image

(I Add Input Variable from Input/Output Screen with the type (primitives->object) wish could put custom type and after i put it in parsed content so i can use it later as i tried in my code version , then as soon as i add the next activity everything disconnects and shows multiple errors

NoorsTah avatar Mar 15 '24 05:03 NoorsTah

Creating an HTTP Post endpoint with a body that can be reused in a custom activity is indeed applicable with Elsa Workflows. The images you've provided seem to be part of a workflow that you're designing, but without the specific details of what you're trying to achieve or the issues you're encountering, it's difficult to provide a precise answer.

However, based on the context provided, here are some general steps you can follow to create an HTTP Post endpoint with a body in Elsa Workflows:

  1. Create an HTTP Endpoint Activity: This activity will serve as the trigger for your workflow. You need to configure it to accept POST requests and define the path that should be used to invoke the workflow.

  2. Configure the HTTP Endpoint Activity: In the settings of the HTTP Endpoint activity, ensure that the "Can start workflow" checkbox is checked. You should also specify the path and the HTTP method (POST in this case).

  3. Handle the Request Body: To handle the request body, you can use the "Read JSON" activity to parse the incoming JSON payload and store it in variables that can be used later in the workflow.

  4. Create a Custom Activity: If you need to perform specific logic that is not covered by the built-in activities, you can create a custom activity. This involves writing code to define the activity's behavior and integrating it into your workflow.

  5. Use the Request Body in Your Custom Activity: You can access the variables set by the "Read JSON" activity in your custom activity to perform the necessary operations.

  6. Respond to the Request: Finally, you can use the "Write HTTP Response" activity to send a response back to the caller. You can configure the status code, content, and headers as needed.

If you're encountering a specific error or issue with your workflow, please provide more details so that I can offer a more targeted solution. Additionally, you can refer to the Elsa Workflows documentation and samples for guidance on creating HTTP workflows and custom activities.

glime-ai[bot] avatar Mar 15 '24 05:03 glime-ai[bot]

@NoorsTah Can you show us the server side error?

sfmskywalker avatar Apr 05 '24 22:04 sfmskywalker