Handlers

Handlers define what happens when a trigger fires. They contain execution blocks that run in sequence.

Handler Structure

yaml

Each block has a human-readable name (shown in debug UI) and a type that determines its behavior.

Block Types

next-message

Generate a response from the LLM:

yaml

With options:

yaml

add-message

Add a message to the conversation:

yaml

For internal directives (LLM sees it, user doesn't):

yaml

tool-call

Call a tool deterministically:

yaml

set-resource

Update a persistent resource:

yaml

start-thread

Create a named conversation thread:

yaml

serialize-thread

Convert conversation to text:

yaml

Display Modes

Every block has a display property:

ModeDefault ForBehavior
hiddenadd-messageNot shown to user
nameset-resourceShows block name
descriptiontool-callShows description
streamnext-messageStreams content

Complete Example

yaml

Block Input Mapping

Map variables to block inputs:

yaml

Independent Blocks

Use independent: true for content that shouldn't go to the main chat:

yaml

This is useful for:

  • Background processing
  • Summarization in separate threads
  • Generating content for tools