Tuesday, April 21, 2026

Routing, transforms, and replay for AI agents

Hooksbase
Reliability
Delivery activity stream

AI agents are non-deterministic consumers. LLM calls return different text every time. Tool calls have side effects. Retries cost money. So the event pipeline feeding an agent has to be the opposite — deterministic in what it delivers and fully recoverable when something breaks.

Hooksbase keeps routing, transforms, and replay in one event history. Routing evaluates the original source payload, request headers, content type, and verified provider metadata. Transforms run after routing picks a destination but before outbound dispatch. Replay uses the persisted delivery snapshot — not whatever the webhook configuration happens to look like later.

Routing uses source truth

Routing rules match on payload fields, headers, content type, and provider fields like provider.name, provider.eventType, and provider.verified. Match modes are ALL (all conditions must hold) or ANY (at least one).

That makes common agent workflows explicit:

  • Route verified Stripe invoice events to the billing-automation agent
  • Send GitHub issue events to the triage agent via an SQS queue handoff
  • Archive high-volume analytics events to object storage, skipping the agent entirely
  • Fall back to a "catch-all" destination for events no rule matches

Each destination can be a webhook, an AWS SQS queue, an EventBridge bus, a Google Pub/Sub topic, or an S3-compatible object store. Non-webhook destinations start on Pro, so agents can receive events through queues or object storage when the project tier supports them.

Transforms are deterministic

Hooksbase supports JSONPath extraction and Handlebars JSON templates on Starter+. The source payload remains the billable stored payload. Successful transforms persist a separate dispatch snapshot — the exact bytes the destination receives.

Retries, DLQ re-drive, direct replay, and Starter+ bulk replay all reuse that dispatch snapshot. If you change the transform later, old deliveries still replay from the version that actually ran while the payload is retained.

Recovery stays explainable

When an agent fails (LLM timeout, tool call error, downstream 500, anything), Hooksbase preserves the full chain of custody:

  • delivery record with source channel, route decision, and provider metadata
  • all attempt rows with request/response details
  • dispatch snapshot so replays are deterministic
  • replay lineage via replay_of_delivery_id
  • DLQ row if the terminal state is failure
  • file references if email or form uploads were involved
  • quota impact so cost is visible

Starter+ bulk replay handles the easy case — re-drive up to 500 failed events after fixing the agent code. Single replay handles the hairy case — inspect one retained delivery, confirm what was sent, trigger a re-run with the exact same payload while it is retained.

For agent teams, this turns incident response from "good luck debugging" into "open the DLQ, fix the agent, click replay."

Keep reading