aiAI TOOLS.
THE ARTIFICIAL INTELLIGENCE DIRECTORY
Top 100
◎  EN
Build a workflow

Webhooks: notifications and task tracking

Understand the difference between viewing a state and receiving an event, with an example of a video generation.

A notification sent to your service

A webhook allows a service to call an address you set up when an event occurs. For a long task, the API can warn your application that the result is ready. The polling is different: your application consults the state itself at regular intervals. Choose according to the rules and possibilities of the supplier.

A webhook is not just a message displayed to a visitor. This is a request received by your application, which must verify its source and process its content. The methods of signature or authentication depend on the service.

Linking the event to the right task

Keep the identifier returned when creating. When the notification arrives, link it to the expected task and check its status. Do not confuse an update event with a confirmation of success. Final files may request a separate recovery.

Predict repetitions and errors

A notification may be repeated according to the delivery rules. Your treatment should avoid doing twice the same action. Also prepare for delays, unexpected events and errors on your own server. A successful HTTP response to the webhook does not prove that any business operation is complete.

Test the workflow with fictitious data and keep track of identifiers. Limit the information stored in logs. Check the time and possibilities for recovery or re-delivery in the current documentation.

Questions before you start

Are Webhook and polling identical?

The webhook receives a notification; the polling regularly consults the status of the task.

Can a notification happen several times?

Provide supplier delivery rules and avoid duplicate shares.

Should we check the provenance?

Yes. Use documented authentication or signature mechanisms.

Continue learning

Official documentation