Introduction
Modern business applications constantly exchange information with one another to automate processes, maintain data consistency, and improve operational efficiency. Traditionally, systems relied on repeated API polling or manual data transfers to detect changes and synchronize information.
Webhooks provide a more efficient and event-driven alternative by allowing applications to communicate instantly whenever a specific event occurs. Instead of repeatedly checking for updates, a webhook automatically sends data from one application to another through an HTTP callback whenever a defined action is triggered.
In uKnowva HRMS, webhooks can be configured to automate various operations such as attendance synchronization, employee data transfer, workflow updates, and external system integrations. By using webhooks, organizations can ensure real-time communication between systems while reducing manual intervention and processing delays.
In this article, you will learn what webhooks are, why they are important, and how to configure and use webhooks in uKnowva HRMS using an attendance synchronization example between two instances.
Understanding Webhooks
What is a Webhook?
A webhook is an HTTP-based callback function that enables lightweight, event-driven communication between two application programming interfaces (APIs). Instead of continuously polling systems for updates, webhooks automatically send data whenever a specific event occurs, allowing applications to communicate in real time.
Webhooks are widely used by modern web applications to exchange small amounts of information efficiently between systems. They can also be used to trigger automation workflows in GitOps environments, where infrastructure and operational processes are managed through automated actions and version-controlled changes.
Because webhooks connect event sources directly to automation solutions, they play an important role in event-driven automation. This means that whenever a predefined event occurs, such as attendance creation, employee updates, or workflow approvals, the webhook can automatically trigger IT actions or integrations without requiring manual intervention.
This approach improves efficiency, reduces unnecessary API requests, and enables systems to react instantly to operational changes.
Why Are Webhooks Important?
Traditional API interactions often involve continuous polling, where one application repeatedly checks another application for updates. This approach can be resource-intensive, slower, and inefficient when real-time communication is required.
Webhooks solve this problem by enabling applications to communicate instantly through event-driven triggers. Whenever an event occurs in the source application, a webhook automatically sends the relevant information to the destination application without requiring repeated checks.
This real-time communication enables organizations to automate workflows, improve synchronization accuracy, reduce delays, and create more interconnected systems. For example, attendance marked in one uKnowva instance can automatically update another instance without manual intervention.
Webhook Configuration Example in uKnowva HRMS
For this demonstration, we will use two separate uKnowva instances:
-
Instance A
-
Instance B
The example shown in this article demonstrates the “Push Single Attendance Record” webhook process.
Step 1: Generate Authentication Token from Instance A
To begin, open Instance A and generate the authentication token required for webhook communication.
Follow the authentication setup process as explained in the API authentication documentation. Once the authentication setup is completed successfully, copy the generated token securely. This token will later be used in the webhook header configuration to authenticate requests between the two instances.

Step 2: Open Webhooks Module in Instance B
Now log in to Instance B. From the left-hand navigation menu, click on the Webhooks option to open the webhook management page.

This section allows administrators to create, configure, and manage all webhook integrations within the system.

Step 3: Create a New Webhook
Inside the Webhooks page, click on the Add button to create a new webhook configuration.

This opens the Webhook configuration page where you can define all required webhook settings for the integration.

Step 4: Configure Basic Webhook Information
Start by entering the Webhook Name and Webhook Description. These details help identify the purpose of the webhook and make future management easier.

After entering the basic details, select the appropriate Webhook Table from the drop-down menu. This table determines the source module from which events and data will be triggered.

Step 5: Select Webhook Event and Additional Views
Next, select the Webhook Event from the drop-down menu based on the operation you want to perform.
For this example, select the INSERT event so that the webhook triggers whenever a new attendance record is created.
You can also configure the Webhook View if you want to send additional information along with the event data. Although this is optional, it allows you to include extended details when required.

After selecting the view, configure the Webhook View Join Condition according to your requirements. You can also add multiple conditions using the “+” icon to control how data is fetched from related tables.

Step 6: Configure Webhook URL, Method, and Authentication
Now paste the target API Endpoint into the Webhook URL field.
Next, select the appropriate Webhook Method based on the API requirements, such as POST or GET.

After selecting the method, enter the authentication token copied from Instance A into the Webhook Header Param section. This ensures that webhook requests are securely authenticated before data transfer occurs.

If you wish to enable OAuth2 authentication for webhooks, you can follow this tutorial to learn how to configure OAuth2 settings.

Step 7: Configure Webhook Body Type and Conditions
Before saving the webhook, verify the API body format and select the correct Web Hook Body Type.
For example, if the API expects x-www-form-urlencoded data, select the same body type and define the required key-value mappings in the Webhook Body section.

Enable the Published toggle to ensure the webhook remains active. You can also define the maximum number of records to be processed per request if required.
For advanced customization, developers can use the “On Before Webhook Senddata” and “On After Webhook Senddata” sections to execute custom PHP logic during webhook processing.
The “On Before Webhook Senddata” section is used when you want to modify, validate, or prepare the data before it is sent to the destination system. For example, suppose you are sending employee attendance data to another application, but the external system only accepts attendance status values as “P” and “A” instead of “Present” and “Absent.” In this case, developers can write PHP logic in the “On Before Webhook Senddata” section to automatically transform the attendance values before the webhook request is sent.
Similarly, the “On After Webhook Senddata” section is used when actions need to be performed after the webhook execution is completed. For example, after successfully sending attendance data to another system, developers may want to update a custom status field, generate logs, or store the webhook response for audit and troubleshooting purposes.

If the selected Webhook Event is set to UPDATE, the system provides additional execution conditions to control exactly when the webhook should trigger.

For example, if employee records are updated frequently but you only want the webhook to trigger when the employee’s department changes, you can select the option “Any selected field is updated” and choose the field.

Similarly, if multiple fields are selected under “All selected fields are updated,” the webhook will execute only when all those specified fields are updated together. This is useful in scenarios where integrations should run only after a complete set of information is modified, and if you wish to execute the webhook every time any field is updated, simply select the “Any field is updated” option.

You can also configure additional AND/OR conditions to further refine webhook execution behavior. For example, you may configure the webhook to trigger only when the employee department is “Sales.”

This ensures that the webhook executes only for records matching specific business rules, improving accuracy and reducing unnecessary API calls.
Step 8: Save the Webhook Configuration
After completing all mandatory configurations and verifying the entered information carefully, click on the Save button to create the webhook successfully.
Step 9: Execute Cron Configuration
After saving the webhook, go to the uKnowva Configuration section and open the Global Configuration page.
Scroll down until you locate the Execute Cron option and click on it.

Before running cron tasks, make sure the appropriate IP address is entered within the “Allowed IPs to run Scheduled cron tasks” setting. This ensures that cron execution remains secure and authorized.
Step 10: Trigger Attendance Record for Webhook Execution
Now navigate to the Team menu and select the Attendance Report sub-menu from the side navigation panel.

Select the user whose attendance record you want to synchronize through the webhook.

Click on the required attendance date, add the attendance details, and click on the Save button.

This attendance creation action triggers the configured webhook event.
Step 11: Verify Attendance Synchronization
After saving the attendance in Instance B, execute or refresh the scheduled cron task configured for webhook processing. This step processes the pending webhook queue and sends the attendance data to the connected instance.
Now switch to Instance A and open the View Attendance Calendar page for the user.
Initially, the employee may appear absent on the selected date in Instance A.

However, after webhook synchronization and clicking the Sync Attendance button, the attendance record from Instance B will automatically synchronize with Instance A, marking the employee as present for that date.

Conclusion
That’s it!
You’ve now successfully configured and used webhooks in uKnowva HRMS for real-time attendance synchronization between two instances.
By following this process, you can automate communication between systems, eliminate manual data transfer, and ensure faster and more accurate synchronization of records across applications.
If you have any questions or need additional support, feel free to contact us at This email address is being protected from spambots. You need JavaScript enabled to view it..



