What is a routing rule?
A routing rule is a priority-ordered condition that selects which destination handles an event. Each webhook can have multiple rules; the first one that matches an event decides where it goes.
Rules let one webhook send different event types to different destinations without producer-side coordination.
What rules can match on
Each rule is a list of conditions plus a target destination. Conditions can match on:
- Content type —
application/json,application/x-www-form-urlencoded, etc. - Headers — any header on the inbound request
- Payload fields — any JSON path into the event payload
- Provider fields —
provider.name,provider.eventType,provider.sourceId,provider.verifiedfor verified providers
Operators include eq, neq, contains, starts_with, exists, in, gt, gte, lt, and lte. Conditions within a rule can be combined with ALL (AND) or ANY (OR) match modes.
Rule order matters
Rules evaluate in priority order. The first matching rule wins; later rules with matching conditions don't fire. This means the order you define rules in is part of the configuration.
A common pattern:
- High-specificity rule first (e.g.
event.type == "payment.failed" AND amount > 10000) - General rule second (e.g.
event.type starts_with "payment.") - Default destination catches everything else
If you reverse the order of #1 and #2, the high-value-payment rule never fires.
Why this beats hardcoding routing in the producer
Without rules, the producer would need to know which consumer should receive which event and POST to the right URL itself. Rules invert that — the producer POSTs once; Hooksbase decides where each event goes. Adding a new route is a configuration change, not a producer change.
For the design walkthrough: Route events to the right agent.
Frequently asked questions
What can a routing rule match on?
Content type, any header on the inbound request, any JSON path into the payload, and provider fields such as provider.name, provider.eventType, provider.sourceId and provider.verified. Operators include eq, neq, contains, starts_with, exists, in, gt, gte, lt and lte, combined within a rule using ALL or ANY.
Does the order of routing rules matter?
Yes. Rules evaluate in priority order and the first match wins, so the order you define them in is part of the configuration. Put the high-specificity rule before the general one; reversed, the specific rule never fires because the general one already matched.
What is Hooksbase?
Hooksbase is event infrastructure for AI agents. It ingests events over four channels — HTTP, email, HTML form, and scheduled cron — verifies them, routes them by rule, runs versioned Automations in the event path, and delivers them to HTTP and cloud destinations (AWS SQS, AWS EventBridge, GCP Pub/Sub, and S3-compatible storage) with retries, strict ordering, Standard Webhooks-compatible signing, deterministic replay, and a dead-letter path. It is a hosted service, runs on Cloudflare Workers, is operated at hooksbase.com, and is not affiliated with — and shares no code or ownership with — other similarly named webhook, hook, or tunnelling tools.
Related terms
- Destination
A target URL or typed sink within a webhook; a webhook can have many.
Read - Default destination
Fallback destination for events no routing rule matches.
Read - Fan-out
Delivering one event to multiple consumers in parallel.
Read - Scheduled ingest
Firing a webhook on a recurring cron cadence with no external producer.
Read