Skip to content

Webhooks

Send and receive webhooks with signature validation.

Receive Webhooks

Configuration

json
{
  "webhooks": [
    {
      "name": "stripe-events",
      "path": "/webhooks/stripe",
      "provider": "stripe",
      "secret": "{{env.STRIPE_WEBHOOK_SECRET}}",
      "actions": [{
        "type": "database",
        "action": "insert",
        "params": {
          "table": "webhook_events",
          "data": {
            "type": "{{payload.type}}",
            "data": "{{payload}}"
          }
        }
      }]
    }
  ]
}

Supported Providers

ProviderSignature HeaderAlgorithm
stripeStripe-SignatureHMAC-SHA256
githubX-Hub-Signature-256HMAC-SHA256
slackX-Slack-SignatureHMAC-SHA256
twilioX-Twilio-SignatureHMAC-SHA1
customConfigurableHMAC-SHA256

Webhook Actions

Execute actions when webhook received:

json
{
  "actions": [
    {
      "type": "database",
      "action": "insert",
      "params": {
        "table": "events",
        "data": "{{payload}}"
      }
    },
    {
      "type": "slack",
      "action": "sendMessage",
      "params": {
        "channel": "#events",
        "text": "Webhook: {{payload.type}}"
      }
    }
  ]
}

Conditional Actions

json
{
  "actions": [{
    "condition": "{{payload.type}} === 'payment_intent.succeeded'",
    "type": "sendgrid",
    "action": "sendEmail",
    "params": {
      "to": "{{payload.data.object.receipt_email}}",
      "subject": "Payment Received"
    }
  }]
}

Send Webhooks

In Routes

json
{
  "path": "/orders",
  "method": "post",
  "integrations": [{
    "type": "webhook",
    "action": "send",
    "params": {
      "url": "https://example.com/webhook",
      "method": "POST",
      "headers": {
        "X-Custom-Header": "value"
      },
      "body": {
        "event": "order.created",
        "data": "{{body}}"
      },
      "secret": "{{env.WEBHOOK_SECRET}}"
    }
  }]
}

In Workflows

json
{
  "id": "notify-external",
  "steps": [{
    "id": "send-webhook",
    "type": "integration",
    "integration": "webhook",
    "action": "send",
    "params": {
      "url": "{{input.webhookUrl}}",
      "body": {
        "event": "task.completed",
        "taskId": "{{input.taskId}}"
      }
    }
  }]
}

Webhook Signing

Send with Signature

json
{
  "params": {
    "url": "https://example.com/webhook",
    "body": { "event": "order.created" },
    "sign": true,
    "secret": "{{env.WEBHOOK_SECRET}}",
    "signatureHeader": "X-Signature"
  }
}

Verify Signature (Custom)

json
{
  "webhooks": [{
    "name": "custom-webhook",
    "path": "/webhooks/custom",
    "provider": "custom",
    "secret": "{{env.WEBHOOK_SECRET}}",
    "signatureHeader": "X-Signature",
    "algorithm": "sha256"
  }]
}

Examples

GitHub Webhook

json
{
  "webhooks": [{
    "name": "github",
    "path": "/webhooks/github",
    "provider": "github",
    "secret": "{{env.GITHUB_WEBHOOK_SECRET}}",
    "actions": [{
      "condition": "{{payload.action}} === 'opened'",
      "type": "slack",
      "action": "sendMessage",
      "params": {
        "channel": "#github",
        "text": "New PR: {{payload.pull_request.title}}"
      }
    }]
  }]
}

Stripe Webhook

json
{
  "webhooks": [{
    "name": "stripe",
    "path": "/webhooks/stripe",
    "provider": "stripe",
    "secret": "{{env.STRIPE_WEBHOOK_SECRET}}",
    "actions": [
      {
        "condition": "{{payload.type}} === 'customer.subscription.created'",
        "type": "database",
        "action": "insert",
        "params": {
          "table": "subscriptions",
          "data": {
            "stripe_id": "{{payload.data.object.id}}",
            "customer_id": "{{payload.data.object.customer}}"
          }
        }
      }
    ]
  }]
}

Webhook Endpoints

MethodEndpointDescription
POST/webhooks/sendSend webhook
GET/webhooks/historyList received webhooks
GET/webhooks/history/:idGet webhook details

Released under the ISC License.