Skip to main content
Triggers subscribe to events and run a handler when those events fire. Unlike conversations (which respond to user messages), triggers respond to system events, integration events, and custom events you define.

Creating a trigger

Create a file in src/triggers/:
The events array lists which events this trigger subscribes to. The handler runs when any of the listed events fire.
Trigger names must be at least 3 characters and contain only alphanumeric characters and underscores.

Viewing triggers in the dev console

You can browse your triggers from the dev console at Components > Triggers:
Triggers page in dev console

Event format

Events use the format "integration:eventName" for integration events, or just the event name for custom events defined in agent.config.ts. The handler receives a single event parameter: To make API calls from a trigger, pull the client from the runtime context: const client = context.get("client").

Multiple events

A trigger can subscribe to multiple events and handle each differently:

Custom events

Triggers can subscribe to custom events you define in agent.config.ts:
agent.config.ts
src/triggers/on-order.ts

Using actions from triggers

Triggers can call actions for reusable logic:
Last modified on April 27, 2026