Webhook (Automation)

Receive real-time data from another application. (Just apply with Automation)

Description

The Webhook component facilitates real-time data transmission between applications whenever a specific event occurs. In our algorithm, the webhook acts as an input, enabling our system to receive and process data instantly upon the triggering event.

Component settings

Parameter Name
Description

Webhook endpoint

You can turn this option on or off with a button.

When enabled, it will provide you with the URL (Include API Key) for the Diaflow webhook builder and the request body.

API Key

You can choose API Key from the list of API Keys on your Workspace **In case the list of API Keys on your Workspace is null, you can "Create new API Key" on the node

Body

You can add a key and specify whether it is Required or Optional.

Use case

Here's a use case for the Webhook component: it is used to analyze a PDF document by asking, "How to scale the B2B engine?"

How to Set up a node Trigger Webhook

Step 1: Set Up the Node Trigger Webhook

Setting up the node trigger webhook. In the "Config" tab, select Type = "When Webhook Received"

Step 2: Enable the Webhook Endpoint

Switch the "Webhook endpoint" toggle to ON.

Step 3: Choose API Key

Choose API Key from your API Keys List.

Make sure that your API Key is included in the header when calling the webhook. This security

measure helps protect your data and environment.

If your list is "Null" -> At node, you can "Create new API Key"

Step 4: Configure the Body Fields

Enter the values in the Body section. These are the data fields the system will receive from the Webhook. You can mark them as "Optional" or "Required".

Note: If the system receives a Webhook request that does not contain the required fields, an error will be returned.

Step 5: Preview the Webhook

You can test the Webhook using one of the following methods:

Method 1: Test with URL

  1. Select test method = "Test with URL".

  2. Recommendation: Use Postman to preview the Webhook.

Steps to Test with Postman

  • Copy the Webhook URL on Diaflow

  • Open Postman.

  • Use the "POST" method.

  • Paste the Webhook URL.

  • Go to the "Header" tab:

    • Key = x-api-key

    • Value = Paste the API Key of Diaflow system

  • Go to the "Body" tab:

    • Select "Raw" format.

    • Enter the data fields (e.g., Name, Age, Gender).

  • Click "Send".

  • If the response contains "success": true, the connection is successful. You can now use this Webhook configuration to transmit data.

Method 2: Test with Sample Data

  1. Select test method = "Test with sample data".

  2. Create sample data.

This setup ensures your Webhook is properly configured and ready to receive data.

Last updated

Was this helpful?