Quick Start
1
YAML gateway channel (recommended, no code)
Declare a
webhook channel in gateway.yaml. The gateway recognises webhook as a built-in channel type.2
Python (single bot)
How It Works
Every POST is verified, filtered, templated, then dispatched to the agent through the durable session manager.User interaction flow
A developer wires the route once; the external service does the rest.Configuration Reference
WebhookBot serves one HTTP path and dispatches matching events to its bound agent.
WebhookRoute decides which events fire and how the prompt is built.
The YAML
verify.hmac block is parsed by _build_verifier_from_config.
Filter DSL
A filter is a small predicate tree that round-trips through YAML. Every node is either a combinator or a leaf.
A leaf tests one field:
{"field": "<dotted.path>", "<op>": <value>}.
Field paths are dotted —
payload.issue.number, headers.X-GitHub-Event, query.debug. Header lookup is case-insensitive.
Fail-safe by design. Missing paths resolve to
None; unknown nodes, invalid regex, and type mismatches evaluate to False and never raise. A None or {} filter matches every event, so a route with no when is unconditional.Which operator?
Routing and prompts
First-match wins. Routes are evaluated in list order; the first whose filter matches is used. A filter that raises is skipped (fail-safe) so a bad route can’t kill ingress. Prompt templating.{{ dotted.path }} placeholders resolve against {payload, headers, query}. Missing paths render as empty strings. When prompt is omitted, the raw JSON payload becomes the agent’s prompt.
Silent routes. silent: true acknowledges with HTTP 200 without running the agent — useful for dropping noisy events at the edge.
Delivery IDs. The bot derives a stable message_id for the ingress journal, in priority order:
X-GitHub-Deliveryheader, orX-Request-Idheader, orX-Delivery-Idheader, orStripe-Signatureheader, otherwise- deterministic
webhook-<sha256(path + "\0" + raw_body)>fallback, so redeliveries collapse to one journaled run even for generic senders.
Response contract
Common Patterns
GitHub issue triage
Verify the signature, match the event header and body, then template the prompt.Stripe payment fan-in
Match several event types with onein leaf.
Silent-drop noisy events
Put asilent: true route before a broad catch-all to drop noise at the edge.
Best Practices
Always set an HMAC secret in production
Always set an HMAC secret in production
Signature verification is opt-in — a
webhook channel with no verify block accepts unsigned traffic. Set verify.hmac.secret from an env var before exposing the endpoint.Put narrow routes before broad ones
Put narrow routes before broad ones
First-match wins, so a specific route placed after a catch-all never runs. Order routes from most to least specific.
Use silent routes for high-volume noise
Use silent routes for high-volume noise
silent: true acknowledges without running the agent, keeping the ingress journal clean for events you never want to act on.Prefer YAML gateway config over Python
Prefer YAML gateway config over Python
For anything shared across an environment, declare the channel in
gateway.yaml rather than constructing WebhookBot(...) in code — config is easier to review and redeploy.Related
Webhook Verification
The HMAC signature primitive this channel reuses
Bot Platform Plugins
The registry seam that
webhook slots intoChannels Gateway
The gateway that hosts channel adapters
Inbound Journal
Dedup and retry behaviour that
message_id feeds
