Webhook

Add a Webhook component to your flow to trigger it with external requests.

To connect the Webhook to a Parser component to view and parse your data payload, do the following:

  1. Add a Webhook component to your flow.

  2. Add a Parser component to your flow.

  3. Connect the Webhook component's Data output to the Parser component's Data input.

  4. In the Template field of the Parser component, enter a template for parsing the Webhook component's input into structured text. Create variables for values in the template the same way you would in a Prompt component. For example, to parse id, name, and email strings:

ID: {id} - Name: {name} - Email: {email}

  1. In the Endpoint field of the Webhook component, copy the API endpoint for your external requests.

  2. Optionally, to retrieve a complete example request from the component, click Controls, and then copy the command from the cURL value field.

  3. Send a POST request with any data to trigger your flow. This example uses id, name, and email strings. Replace YOUR_FLOW_ID with your flow ID.

curl -X POST "https://use.broxi.ai/api/v1/webhook/YOUR_FLOW_ID" \
    -H 'Content-Type: application/json' \
    -d '{"id": "12345", "name": "alex", "email": "alex@email.com"}'

This response indicates BroxiAI received your request:

{"message":"Task started in the background","status":"in progress"}

  1. To view the data received from your request, in the Parser component, click .

You should see a string of parsed text, like ID: 12345 - Name: alex - Email: alex@email.com.

You have successfully parsed data out of an external JSON payload.

By passing the event trigger data payload directly into a flow, you can also parse the event data with a chain of components, and use its data to trigger other events.

Last updated