fixed
Preventing Cyclic Execution in Webhook Service
9 months ago by ReadMe API
A cyclic execution issue was identified in the webhook service when the webhook destination was set to the Authvia Trigger API to create a business process, and the webhook type was configured as business_process:create
or business_process:update
. This document details the implemented solution to prevent infinite loops by introducing an origin header and execution checks.
Problem
- When a business process is created or updated, it triggers the webhook to receive business process create or update events.
- Suppose the webhook's destination is the Authvia Trigger API URL configured to create a business process. In that case, the webhook initiates a call to that destination, creating a new business process.
- This new business process creation triggers the webhook again, leading to an endless loop of webhook executions on business process creation or update events.
Solution
- Each service invocation now includes a unique identifier in the request headers.
- The system checks if the unique ID originated from the current service URL.
- If the unique ID is detected as originating from the current URL, the process halts to prevent recursive calls.
Additional Updates
autoDisable
Field Addition (2024-12-02) : Introduced theautoDisable
field to enhance validation when creating webhooks for merchants.- Trigger Existence Validation (2024-12-13): Implemented validation to ensure the existence of a trigger for a merchant when the destination URL is set to Authvia Trigger.
These measures enhance system stability and prevent unintended recursive executions.
https://developer.authvia.com/v3.3/reference/create-webhook-subscription