You can register webhooks for each workflow to receive result, status update and observability events.

Here are the different events you can subscribe to:

Simply navigate to our settings page to get started.

Security

We sign webhook events with the secret you get when you register a webhook. We also add an expiry time. You can change the expiry time in the setting of the registered webhook.

Here’s how we recommend to verify the message you receive from us:

import time
import hashlib
import hmac
import json

class VerificationError(Exception):
"""Custom exception to handle verification errors."""
def **init**(self, message="Verification failed", status_code=400):
super().**init**(message)
self.status_code = status_code

def verify_hmac(received_data, received_signature, secret_key): # Ensure the received data is in bytes, necessary for HMAC
if isinstance(received_data, str):
received_data = received_data.encode()

    # Generate the HMAC new object with the secret key and SHA-256
    calculated_signature = hmac.new(secret_key.encode(), received_data, hashlib.sha256).hexdigest()

    # Safely compare the computed HMAC with the received HMAC
    return hmac.compare_digest(calculated_signature, received_signature)

def verify_message(received_data, received_signature, secret_key):
if not received_data:
raise VerificationError("Received request without body", 400)
try:
data_json = json.loads(received_data.decode('utf-8'))
except json.JSONDecodeError as e:
raise VerificationError("Failed to decode json: " + str(e), 400)

    # Check if the expiration is sent
    expires_at = data_json.get("expires_at")
    if not expires_at:
        raise VerificationError("No expiration date sent", 400)

    # Verify HMAC first
    if not verify_hmac(received_data, received_signature, secret_key):
        raise VerificationError("Invalid HMAC signature.", 401)

    # Check if the message is not expired
    if time.time() > expires_at:
        raise VerificationError("Webhook message expired.", 400)

    return data_json

Deliverability

CloudCruise tries resending webhooks 2 times. You can also trigger a manual resend over your CloudCruise dashboard in the run detail view. Alternatively, you can send a POST request to api.cloudcruise.com/webhooks/replay/{your_session_id}.