Trigger Workflow via WebHook

Nected allows you to securely initiate a workflow from your systems using a Webhook URL. This feature enables you to pass custom parameters and retrieve all pertinent information related to the workflow, ensuring seamless integration and efficient data handling.

To trigger a workflow via webhook, follow these steps:

  1. Test and Publish the Workflow: Ensure the workflow you want to trigger is tested and published.

  2. Access the Trigger Node:

    • Go to the Trigger Node and click on it.

    • Navigate to the Settings tab, where you will find the API and WebHook URL information.

  3. Use the WebHook URL:

    • The Settings tab will display the WebHook URL, which contains all the information and behavior of the workflow trigger.

    • Use the URL to trigger the workflow via WebHook. Below is the URL:

<https://nected-xx.nected.io/nected/webhook/{env}/workflow/{id}/>

The WebHook URL consists of the following components:

  • Base URL: https://nected-xx.nected.io/nected/webhook

  • env: The environment of the rule, either staging or production.

  • entity_name: The name of the rule to be executed.

  • id: The ID of the rule.

Inside the 'How to Trigger?' section you'll get this type of cURL code, which you can copy and use seamlessly:

curl -X "POST" "https://nected-xx.nected.io/nected/webhook/production/workflow/65df54bb85d91df40fxxxxx" \
     -H 'Content-Type: application/json' \
     -d $'{
  "Transaction_amt": 10000,
  "aoi": 100000,
  "customer_id": "customer1",
  "date": "21/02/2024",
  "n_list": [
    "ABC",
    [
      2000,
      "Nected",
      "2024-07-02"
    ],
    "2024-07-02T05:47:10Z",
    {
      "key_name_1": "Rule Engine",
      "key_name_2": true
    },
    true
  ],
  "sensor_id": "Prod12"
}'

Passing Custom Attributes Using Webhook

  • After Selecting the Webhook URL, you can use the webhook to pass the information as a custom attribute.

  • To pass custom attributes in Workflow via using WebHook, You can use this flattened payload structure like this:

    {
      "Transaction_amt": 10000,
      "aoi": 100000,
      "customer_id": "customer1",
      "date": "21/02/2024",
      "n_list": [
        "ABC",
        [
          2000,
          "Nected",
          "2024-07-02"
        ],
        "2024-07-02T05:47:10Z",
        {
          "key_name_1": "Rule Engine",
          "key_name_2": true
        },
        true
      ],
      "sensor_id": "Prod12"
    }
  • Once You pass the payload, the webhook will not wait for the workflow execution it runs asynchronously backend. after its successful execution, it responds via a successful message.

Last updated