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

ActionRegistry

Routes agent run actions to handler blocks 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 blocks 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

Rails integration

A typical setup in a Rails initializer:
Then in your webhook controller: