Webhooks in the self-managed server

This article describes how the self-managed server executes webhook automations.

Execution

When you set up a webhook, ActivityInfo will send a notification to your specified URL whenever a record is changed (created, updated, or deleted) that matches your automation's trigger.

When a webhook is triggered, our server sends the data to your URL and waits a maximum of 15 seconds for a response.

  • Success: If your server responds with a success status (any 2xx code, like 200 OK) within this time, the process is marked as complete. Any previous error message stored for this automation will be cleared.

  • Failure: The attempt is considered a failure if your server:

  • Takes longer than 15 seconds to respond (a timeout).

  • Returns an error status (like 404 Not Found or 500 Server Error).

  • Is unreachable (e.g., a DNS failure or connection refused).

  • Responds with a redirect (see below).

Redirects are not followed

Please note: ActivityInfo does not follow redirects when sending webhooks.

If your server responds with a redirect status (like 301, 302, or 307), it will be treated as a failure, even if the new Location is valid. This will trigger the retry process described above.

Please ensure your webhook URL is the final, direct endpoint and does not require a redirect.

Retry process

If the first attempt fails, the system will not give up immediately. It will try again three more times, for a total of four attempts.

The waiting period between retries increases, giving your server time to recover:

  • 1st Failure: Waits 10 seconds before the 2nd attempt.
  • 2nd Failure: Waits 30 seconds before the 3rd attempt.
  • 3rd Failure: Waits 90 seconds before the 4th (and final) attempt.
  • 4th Failure: If the final attempt fails, the system gives up and will not try again.

What is logged

ActivityInfo will keep track of the last error, which is displayed in the user interface.

  • On Success: Any previous error message stored for this automation is cleared.
  • On Failure (e.g., 404 Error): If your server responds with an error, the response code and message are saved (e.g., 404,Not Found ).
  • On Failure (e.g., Timeout): If an exception occurs (like a 15-second timeout), the exception's message is saved.

More detailed information, including errors that are subsequently resolved on retry, are logged to the system logs.

  • Successful Webhook: A message is logged for every successful attempt, including the return code (e.g., Automation: [My Webhook] -> hook successful with return code: 200).
  • Webhook Request: A log is made for every attempt, showing the URL and the result code (e.g., Automation: Webhook request to https://example.com/hook result code is 404).
  • Failed Webhook (Server Error): Logs when a connection fails due to a server error (e.g., http connection failure while sending webhook: 404,Not Found).
  • Failed Webhook (Exception): Logs when a connection fails due to an exception (e.g., exception occurred while sending webhook: java.net.SocketTimeoutException: Read timed out).
  • Internal Errors: Severe errors are logged if the entire automation process fails unexpectedly.

The system logs can be found in ActivityInfo’s data directory, generally /opt/activityinfo/logs on Unix platforms, or C:\ActivityInfoData\logs on Windows Server.

When deploying ActivityInfo as a docker image, you can access the system logs using the following command:

docker logs <container_name_or_id>
Next item
Explanation