Incoming Webhook using Postman
Webhooks can be integrated with Conductor to facilitate communication with other third-party systems such as Slack, Pagerduty, Zendesk, etc.
In this article, let’s look at creating a webhook in Conductor and passing an incoming request to the webhook using Postman.
Creating Workflow
Consider the following workflow that waits for a webhook event from Postman:
To create a workflow:
- Navigate to Definitions > Workflows from the left menu.
- Click Define Workflow and create a workflow including a WAIT_FOR_WEBHOOK task.
For the WAIT_FOR_WEBHOOK task, the input matches are defined as:
"inputParameters": {
"matches": {
"$['data']['recipientId']": "${workflow.input.recipientId}"
}
},
The complete workflow JSON looks like this:
{
"name": "sample-webhook",
"version": 1,
"tasks": [
{
"name": "http_task_uzpd9",
"taskReferenceName": "http_task_uzpd9_ref",
"inputParameters": {
"http_request": {
"uri": "https://orkes-api-tester.orkesconductor.com/api",
"method": "GET",
"connectionTimeOut": 3000,
"readTimeOut": "3000",
"accept": "application/json",
"contentType": "application/json"
}
},
"type": "HTTP",
"optional": false
},
{
"name": "webhook_task_myey4",
"taskReferenceName": "webhook_task_myey4_ref",
"inputParameters": {
"matches": {
"$['data']['recipientId']": "${workflow.input.recipientId}"
}
},
"type": "WAIT_FOR_WEBHOOK",
"optional": false
}
],
"inputParameters": [
"recipientId"
],
"schemaVersion": 2,
"ownerEmail": "riza.farheen@orkes.io"
}
Next, create a webhook to invoke this workflow.
Creating Webhook in Conductor
- From your Conductor server, navigate to Definitions > Webhooks from the left menu.
- Click the New Webhook button and create the webhook with the following configurations.
Under the field “Workflows to Receive Webhook Event”, choose the workflow that includes your webhook task created earlier. Since the platform is Postman, let’s choose the Source Platform as Custom.
Provider a header key and value. Let’s also configure to start the workflow