Nected Docs
Try Nected For Free
  • 5 min QuickStart Guide
  • Getting Started
    • Introduction
    • Core Concepts
    • Use Cases
    • Tech Architecture
    • FAQs
  • INTEGRATIONS
    • Overview
    • Integrations Libraries
      • PostGres
      • MySQL
      • Oracle
      • MS SQL Server
      • Snowflake
      • MongoDB
      • RedShift
      • REST API
      • Google Sheets
      • Slack
    • Managing Integrations
  • DATASETS
    • Overview
    • Managing Dataset
  • Rules
    • Overview
    • Rule Types
      • SimpleRule
      • DecisionTable
      • Ruleset
      • Rule Chain
    • Rule Conditions
    • Rule Actions
    • Concepts
      • Rule Result
      • Test & Publish Rules
    • Add Input Attributes
      • JSON Input Attributes
      • List Input Attributes
  • Triggers
    • Trigger Rule via API
    • Trigger Rule via WebHook
    • Trigger Workflow via API
    • Trigger Workflow via WebHook
    • Scheduler
    • Rule Response Format
  • Workflow
    • Overview
    • Managing Workflow
    • Add Node
      • Action Nodes
        • Rule Node
        • Workflow Node
        • Custom Code Node
        • Database Node
        • REST API Node
      • Control Nodes
        • Loop Node
        • Delay Node
        • Response Node
        • Set Variables Node
        • Switch Block
    • Test & Publish Workflows
  • CODE AND DATABASE QUERIES
    • JavaScript Editor
    • Formula Editor
    • JSON Editor
    • List Editor
    • Excel-like Function
  • Embedded System
    • White-Labelling
    • Embeddable View
  • Self Hosting
    • Overview
    • Infrastructure Sizing
    • New Installation
      • Docker
      • Kubernetes
        • Set Up Kubernetes Cluster on AWS EKS
    • Additional Configuration
      • High Availability
      • Email Setup Guide
    • Upgrade Nected Version
  • Security
    • API Authentication
      • OAuth as part of Authentication under REST API
    • Role Based Access Control (RBAC)
    • SOC 2 Type 2, GDPR, ISO Compliance
  • Audit
    • Audit Trail
    • Approval Flow
    • Version Control & Rollback
    • Import/Export
  • Management API
    • Audit Log API
    • Global Variable API
  • References
    • Attribute Library
    • Global Variables
    • Pre-Configured Tokens
    • Pre-Configured Operators
    • NULL Value Handling/Behavior
    • Troubleshooting Errors
      • Multiple Tabs/Users Edits
      • Limits in Nected
    • Allowed Status Combinations
    • Environments
    • Usage Widget
    • Gen AI
  • ACCOUNT SETTINGS
    • Workspace Setting
      • Date Format and Timezone Settings
Powered by GitBook
On this page
  1. Triggers

Trigger Workflow via WebHook

PreviousTrigger Workflow via APINextScheduler

Last updated 8 months ago

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}/{version}>

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.

  • Version: The version is optional, and will only appear if the rule environment if production.

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"
}'

Well, as we've multi-environment along with multiple versions, it can be confusing for you while working with the API. To minimize your confusion, here is a table clarifying the API behavior based on versions and different environments:

Version
Environment
View
Explanation

✅

✅

"version":"version_value",

"environment":"env_value", (staging/production)

If in your webhook URL, both are written, then simply that specific version of workflow will be executed

✅

❌

"version":"version_value", "environment":"production",

While calling the webhook, in the url, if you've not specified the env but you've specified the version then the default env i.e. production environment of that version will be executed

❌

✅

"version":"latest", "environment":"env_value", (staging/production)

So, if you've not specified the version but the env then the webhook will execute the latest version of the rule of the environment that you've specified i.e. either staging or production.

❌

❌

"version":"latest", "environment":"production",

If you've not specified anything in your webhook url, then by default the latest live/production version of the rule will be called and executed.

This is how the webhook works, so if you're triggering the workflow via WebHook, make sure you follow this and call the webhook accordingly.

As it can be visible, the base URL changed for staging and production like this:

  1. Staging: https://nected-XX.nected.io/nected/webhook/staging/workflow/{id}

  2. Production: https://nected-XX.nected.io/nected/webhook/production/workflow/{id}/0.30

Now, if you've multiple versions, and you want to trigger a specific version of the workflow via webhook, then you can follow this:

  1. Go to the Version Control tab, and click on the "Preview" button for a specific version.

  2. A new tab will be opened for that specific version. Then follow the same steps to go to the Webhook settings.

  3. Then finally copy the URL and other fields.

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.