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
| Provider | Signature Header | Algorithm |
|---|---|---|
stripe | Stripe-Signature | HMAC-SHA256 |
github | X-Hub-Signature-256 | HMAC-SHA256 |
slack | X-Slack-Signature | HMAC-SHA256 |
twilio | X-Twilio-Signature | HMAC-SHA1 |
custom | Configurable | HMAC-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
| Method | Endpoint | Description |
|---|---|---|
| POST | /webhooks/send | Send webhook |
| GET | /webhooks/history | List received webhooks |
| GET | /webhooks/history/:id | Get webhook details |