Skip to content

Webhooks

Turbine sends HTTP POST requests when workflows complete. Configured via the pt_webhooks collection — manageable from the dashboard or the PocketBase API.

For human-readable notifications to Slack, Discord, email, etc., see Notifications.

Creating a Webhook

Create a record in pt_webhooks with:

FieldTypeDescription
urlstringThe endpoint to POST to (required)
eventsjsonArray of event names to subscribe to (required)
enabledboolWhether the webhook is active
secretstringHMAC secret for signature verification (optional)

Events

EventFires when
workflow.SUCCESSWorkflow completed successfully
workflow.ERRORWorkflow failed with an error
workflow.CANCELLEDWorkflow was cancelled
workflow.WAITING_FOR_APPROVALWorkflow is paused at an approval gate
workflow.MAX_RECOVERY_ATTEMPTS_EXCEEDEDWorkflow exceeded max recovery attempts (dead letter)
workflow.*Any of the above events

Example events array: ["workflow.SUCCESS", "workflow.ERROR"]

Payload

json
{
  "event": "workflow.SUCCESS",
  "workflow_id": "abc123",
  "name": "OrderWorkflow",
  "status": "SUCCESS",
  "output": {"order_id": "order-456", "tracking": "TRACK-789"},
  "timestamp": "2026-03-27T12:00:00Z"
}
FieldDescription
eventThe event name (e.g., workflow.SUCCESS)
workflow_idThe workflow ID
nameThe workflow function name
statusThe final status
outputThe workflow result (JSON-parsed if possible)
errorError message (only for ERROR status)
timestampISO 8601 timestamp

Signature Verification

If a secret is set, Turbine signs the payload with HMAC-SHA256 and sends it in the X-Turbine-Signature header.

go
func verifySignature(body []byte, secret, signature string) bool {
    mac := hmac.New(sha256.New, []byte(secret))
    mac.Write(body)
    expected := hex.EncodeToString(mac.Sum(nil))
    return hmac.Equal([]byte(expected), []byte(signature))
}

Delivery

WARNING

Webhooks are fire-and-forget. Each delivery has a 10-second timeout and failed deliveries are not retried — they are only logged. For critical notifications, consider implementing retry logic on the receiving end.

Webhooks are dispatched asynchronously and don't block workflow completion.