In the modern digital era, applications are the staple to everything, from ordering foods to automating subscriptions. To truly tackle the power of applications, seamless communication and real-time data updates between them are crucial.
Sharing real-time data updates between applications simplifies business processes, eliminates manual intervention, and synchronizes information instantly. It allows you to maintain accurate inventory levels, provide proper customer support, and ensure a seamless customer experience.
While traditional API methods can enable communication between applications, webhooks offer a perfect solution when it comes to real-time updates. Webhooks function as event-driven triggers initiating communication and sharing information between the applications. Instead of constantly polling for updates, webhooks allow applications to notify instantly when an event triggers.
Orkes Conductor, built over the battle-tested Netflix Conductor, is a platform for building distributed applications 10x faster. With Conductor-Webhook integration, you can seamlessly connect Conductor with other applications.
In this blog post, let’s dive deeper into the power of webhooks and discover how they can revolutionize the way your applications communicate and collaborate.
Orchestrating your Workflows/Applications with Webhooks
Webhook is an HTTP-based callback function that facilitates the communication between Conductor and other third-party systems. It can be used to receive data from other applications to the Conductor.
Webhook can be used with Conductor in 2 different ways.
- You can start a workflow on receiving an event from other applications via Webhook.
- You can start a task inside a workflow on receiving an event from external applications.
Example Workflow
Let’s see an example workflow that receives an event from Postman.
Step 1 - Create a Workflow with Webhook Task
Initially, you need to create a workflow in Conductor with the “WAIT_FOR_WEBHOOK” task. For this, navigate to Workflow > Definitions from Conductor UI, and click Define Workflow.
Add the WAIT_FOR_WEBHOOK task at the point where you want to receive an event from Webhook. When the workflow reaches this point, it waits for the webhook event. Ensure to provide the input matches as per your requirement. Matches act as the correlation between the incoming webhook events and running workflows to find the instance that should be updated based on the payload from the event.
In this example, I’ve defined the input matches as:
"inputParameters": {
"matches": {
"$['data']['recipientId']": "${workflow.input.recipientId}"
}
},
Let’s say there are 1000 running instances of a workflow with different recipient IDs; when an incoming webhook request comes, it will find and match //data/recipientId field from the incoming message’s JSON with the running workflow, find the matching instance and mark that particular workflow instance’s task as completed.
Step 2 - Create a Webhook in Conductor
Next, let’s create a webhook in Conductor.
You can create a webhook by navigating to the Webhooks option from the left menu.
Provide a webhook name. Under the field Workflows To Receive Webhook Event, you must provide the workflow name, which includes the webhook task. So, this is the case where a task within a workflow begins with events received from Webhook.
You can choose a source platform from the Conductor-supported list. In this example, we are sending the request from Postman, so let's choose the platform as Custom. Provide a header key and value.
While creating a webhook, there is an option to run other workflows on receiving the webhook event. This is the case where a workflow is triggered on receiving a webhook event.
Saving the webhook generates the URL, which will be “Unverified”.
The verification process of the webhook URLs depends on the supported verification methods from Conductor. The Custom type is header-based verifiers, where the URL is verified when the first Webhook event comes with all the header keys and values configured.
Step 3 - Run Workflow
Let’s run the workflow now!
From the Conductor UI left menu, click Run Workflow.
You can click on the workflow ID generated to view the execution.
It is clear from the workflow diagram that the workflow is now waiting for the webhook event.
Step 4 - Send Request from Postman
Next, send the request from the Postman. Create a new request, provide your webhook URL, and change the method to POST.
Provide the header key and value, and the input matches in JSON format. Click Send, and it should return a 200 OK, meaning it was sent successfully.
Now, if we return to the webhook, you can verify that the event has been received. This triggers the workflow in which the webhook task was added.
You can see that the URL has been verified now. And if you check the previous workflow execution, you can verify that it has been completed successfully.
We have also configured to start the workflow “sample_triggered_workflow” on receiving this webhook event. You can verify the same from the Workflow > Executions page.
Ta-da🎉! You have successfully executed your workflow now!
Webhook Security Mechanism
Conductor allows securing the webhook endpoints using different mechanisms. We support the incoming webhooks over HTTPS with the following verification methods:
- Header Verification - Validated based on the predefined header and value.
- Signature Verification - Validated based on the payload signature, which requires configuring the secret and header key on the Conductor side. When the request comes, the Conductor will calculate the request payload hash and match it with the predefined header value.
- Challenge Verification - Validated when the third-party system sends a challenge request that the Conductor server responds to establish trust.
Check out our Webhook documentation to know more details on how the URLs are verified.
Out-Of-Box Webhook Integrations from Conductor
So far, you have understood the configuration steps and the security mechanism provided by Conductor. Now, let’s quickly look at the ready-to-use configurations from Conductor. Conductor supports the Webhook integration with the following third-party applications:
Use Cases: Webhook as a Service
Conductor provides Webhook as a Service, where you can orchestrate different business use cases. This helps streamline the integration and communication between different systems, enabling automation within your organization.
Let’s have a quick look at various use cases:
GitHub
- Enable automated alerts for newly created issues in your repository and establish a system for automated replies.
- To trigger automated deployments whenever a new commit is pushed to the repository.
- Triggering CI builds whenever changes are pushed to the repository.
Slack
- Creating chatbots.
- Employee onboarding.
- Automating scrum updates.
- Automating issue creation messages on support channels.
Stripe
- Automatically email customers for failed payments.
- Get notified when someone pays via the application.
Microsoft Teams
- Notify the team in Microsoft Teams whenever a new deployment is initiated or completed.
- Report issues identified during project execution directly into a Microsoft Teams channel for quick attention.
We built our daily stand-up bot for our engineering team using this integration. Employees post their updates in the application integrated with the Slack app, which is posted on the stand-up channel.
No more messing up with wrong channels, and no worries about missing the updates. That’s how our managers stay informed about the progress and activities of the engineering team.😎
Why don’t you try automating your daily activities like this using Conductor-Webhook integration?
Wrapping Up
In conclusion, webhooks are an incredibly powerful tool that can be effectively leveraged to meet your business requirements. Integrating webhooks with a robust platform like Orkes Conductor can unlock even greater potential to enhance your business efficiency and productivity.
What to wait for? Give a try on Orkes Cloud now! If you are looking forward to trying Conductor for free, leverage Playground - a free tool from Orkes.
Do reach out to our community Slack channel for any queries. Our vibrant team is always here to help you!
Top comments (0)