BrainGrid Controller
Workflow Builder
Events
Webhook Event

Webhook Event

The Webhook Notification Event feature allows users to configure and manage webhook notifications that send alerts to external systems based on specific triggers. This guide covers the setup of webhook notifications, validating their configuration, and handling webhook signatures.

Overview

Webhook Notifications are used to send alerts to an external URL when certain events occur. The setup includes defining the webhook URL, client credentials, and the payload format. This feature ensures that external systems are notified about important updates in real-time.

Configuring a Webhook Notification Event

Configure Webhook Notification Event

To set up a webhook notification event:

  1. Title: Enter a descriptive title for the notification.
  2. Description: Provide a description of the notification event.
  3. Webhook URL: Specify the URL where the webhook notifications will be sent.
  4. Client ID: Enter the client ID for authentication.
  5. Secret Key: Provide the secret key for secure communication.
  6. Notification Subject: Define the subject line for the notification.
  7. Payload: Format the data to be sent in the notification.
  8. Notification Settings: Include additional settings for the notification content.

Steps:

  1. Alice Johnson is setting up a "Webhook Notification" event.
  2. Enter the following details:
    • Title: Database Backup Notification
    • Description: Notification for database backup completion
    • Webhook URL: https://example.com/webhook
    • Client ID: client_123
    • Secret Key: secret_key_abc
    • Notification Subject: Database Backup Completed
    • Payload: { "status": 200, "client_id": "client_123", "subject": "Database Backup Completed", "content": {} }
    • Notification Settings: { "content": "Database backup has been completed successfully." }
  3. Save the configuration.

Outcome: The Webhook Notification event will be configured with the specified title, description, URL, client ID, secret key, subject, payload, and settings.

Validate Webhook Notification Configuration

To ensure the webhook notification is configured correctly:

  1. Action: Review the configured details.

Expected Outcome:

  • Alice Johnson should see the configured values for:
    • Title
    • Description
    • Webhook URL
    • Client ID
    • Secret Key
    • Notification Subject
    • Payload
    • Notification Settings

Trigger Webhook Notification Event

To activate the webhook notification event based on predefined conditions:

  1. Given: The "Webhook Notification" event is configured and the trigger conditions are met (e.g., database backup completion).

  2. When: The trigger conditions are fulfilled.

Expected Outcome:

  • The external application should receive a notification with:
    • Title: Database Backup Notification
    • Description: Notification for database backup completion
    • Webhook URL: https://example.com/webhook
    • Client ID: client_123
    • Secret Key: secret_key_abc
    • Notification Subject: Database Backup Completed
    • Payload: { "status": 200, "client_id": "client_123", "subject": "Database Backup Completed", "content": {} }
    • Notification Settings: { "content": "Database backup has been completed successfully." }

Validate Webhook Signature

To verify the authenticity of the webhook request:

  1. Action: Send a POST request to the validation endpoint with the following details:

    • URL: https://api.dev.example.com/api/v1/workflow/validate-signature
    • Client ID: client_123
    • Signature: generated_signature
  2. Expected Outcome:

    • If the signature is correct:
      • Status: 200
      • Message: Signature verified
    • If the signature is incorrect:
      • Status: 403
      • Message: Signature not verified

Summary

The Webhook Notification Event Setup feature enables users to configure webhook notifications and validate their setup. By defining the necessary details and verifying signatures, users can ensure that notifications are sent accurately and securely to external systems.