Webhook:
The Notif-Webhook node is designed to facilitate automated notifications through webhooks, providing a seamless way to integrate external systems with your workflow. This node is particularly useful for sending alerts or updates to specified URLs, allowing you to keep track of events or changes in real-time. By leveraging webhooks, you can ensure that notifications are sent either continuously or only when specific conditions are met, such as when a queue is empty. This flexibility makes it an essential tool for maintaining efficient communication and monitoring within your projects.
Webhook Input Parameters:
any
This parameter accepts any type of input, serving as a placeholder to trigger the webhook. It does not directly affect the webhook's execution but is required for the node's operation.
mode
The mode parameter determines when the webhook notification should be sent. It offers two options: "always" and "on empty queue". Selecting "always" will trigger the notification every time the node is executed, while "on empty queue" will only send the notification if the queue is empty, ensuring that notifications are sent only when necessary.
webhook_url
This parameter specifies the URL to which the webhook notification will be sent. It is a string value with a default of http://localhost:5000/. This URL should point to the endpoint that will handle the incoming webhook data.
verify_ssl
The verify_ssl parameter is a boolean that determines whether SSL certificates should be verified when sending the webhook request. By default, it is set to True, ensuring secure communication. If set to False, SSL verification will be skipped, which might be useful in certain testing environments.
notification_text
This string parameter allows you to define the message content of your notification. The default value is "Your notification has triggered." This text will be inserted into the JSON payload sent to the webhook URL.
json_format
The json_format parameter is a string that defines the structure of the JSON payload sent to the webhook. The default format is {"text": "<notification_text>"}, where <notification_text> is replaced by the actual notification text. This allows you to customize the payload to match the expected format of the receiving endpoint.
timeout
This parameter sets the maximum time, in seconds, that the node will wait for a response from the webhook URL. It is a float value with a default of 3 seconds, and it can range from 0 to 60 seconds. Adjusting this value can help manage network latency or slow server responses.
Webhook Output Parameters:
None
The Notif-Webhook node does not produce any output parameters. Its primary function is to send notifications via webhooks, and it does not return any data upon completion.
Webhook Usage Tips:
- Ensure that the
webhook_urlis correctly configured to point to a valid endpoint that can process incoming webhook data. - Use the
modeparameter to control when notifications are sent, optimizing for either continuous updates or specific conditions like an empty queue. - Customize the
json_formatto match the expected payload structure of the receiving system, ensuring compatibility and successful data processing.
Webhook Common Errors and Solutions:
requests.exceptions.RequestException
- Explanation: This error occurs when there is a problem with the HTTP request, such as a network issue or an invalid URL.
- Solution: Verify that the
webhook_urlis correct and that the server is reachable. Check your network connection and ensure that the endpoint is configured to accept incoming requests.
json.decoder.JSONDecodeError
- Explanation: This error indicates that the JSON payload could not be decoded, possibly due to incorrect formatting.
- Solution: Ensure that the
json_formatis correctly structured and that any placeholders, such as<notification_text>, are properly replaced with valid data.
requests.exceptions.SSLError
- Explanation: This error occurs when there is an issue with SSL certificate verification.
- Solution: If you are in a testing environment, consider setting
verify_ssltoFalse. For production, ensure that the server's SSL certificate is valid and trusted.
