Skip to main content
The SDK provides two registry classes to replace switch/case chains with a clean, extensible dispatch pattern.

ActionRegistry

Routes agent run actions to handler functions based on action type.

Setup

Dispatch from a run

run.dispatch(registry) iterates over run.actions and calls the matching handler for each action.

Dispatch manually

Introspection

EventRegistry

Routes webhook events to handler functions based on event type.

Setup

Dispatch a webhook payload

Returns true if a handler was found, false otherwise.

Multiple handlers

An event can have multiple handlers — they all run in order:

Introspection

Express integration

A typical setup in an Express application: