Prompt
How do I route different webhook event types to different services?
Latest observation
Oct 5, 2026
OpenAI APIWeb search: off
To route different webhook event types to different services, you typically put a small webhook gateway/router in front of your services.
Common patterns
1) Single ingress endpoint + event dispatcher
- Receive all webhooks at one endpoint, e.g.
POST /webhooks/provider - Verify signature/authentication
- Read the event type from the payload or headers
- Forward or publish the event to the right internal service
Example routing logic:
user.created→ User Serviceinvoice.paid→ Billing Servicerepo.push→ DevOps Service
This can be implemented as:
- an API gateway/reverse proxy with routing rules
- a custom webhook handler
- a message broker + consumer subscriptions
- a serverless function acting as a router
2) Event bus / pub-sub
Instead of directly calling services:
- Webhook receiver normalizes and validates the event
- It publishes to an event bus/topic
- Services subscribe only to the event types they care about
Examples:
- Kafka topics
- RabbitMQ routing keys
- SNS + SQS
- Google Pub/Sub
- Azure Service Bus
This is usually the most scalable and decoupled option.
3) Separate webhook endpoints per service
If the provider allows it, configure different webhook URLs:
/webhooks/billing/webhooks/users/webhooks/devops
This is simpler, but only works if:
- the provider supports multiple webhook endpoints, or
- you can register separate subscriptions for each event type
Recommended approach
If you expect multiple services and event types, use:
Webhook receiver → event bus → service-specific consumers
This gives you:
- loose coupling
- retries and durability
- independent scaling
- easier adding/removing consumers
Important considerations
- Verify signatures before routing
- Make routing idempotent to handle retries/duplicates
- Return 2xx quickly to the webhook provider
- Store raw payloads for debugging/auditing
- Use DLQs or retry queues for failed deliveries
- Version event schemas if multiple services consume them
Simple example
Webhook Provider
|
v
Webhook Receiver
|
+--> publish "user.created" --> User Service
+--> publish "payment.succeeded" --> Billing Service
+--> publish "ticket.opened" --> Support Service
If you want, I can show you:
- a Node.js/Express example,
- a Python/FastAPI example, or
- an architecture using Kafka/RabbitMQ/SQS.