Skip to main content
Orchestration

Webhooks

Trigger agent sessions directly from external webhooks using Hono.

Use a lightweight HTTP server to receive webhooks and drive an agent. This example uses Hono to receive Slack webhooks and call an agent directly.

Example: Slack webhook to agent

How it works

  1. Slack sends an HTTP POST to /slack/events
  2. The Hono handler validates the event and prompts one durable AgentOS session
  3. AgentOS automatically serializes concurrent prompts targeting that session
  4. The handler posts the response back to Slack

No application queue is needed for prompt ordering. Durable session history remains in SQLite, but AgentOS never automatically replays a prompt whose delivery was uncertain.

Recommendations

  • The direct example waits for the turn. If the provider requires an immediate 200, use the hosting platform’s durable background-task primitive and call AgentOS from that task.
  • Store webhook secrets in environment variables, not in code.