Skip to main content
While execute() lets the AI model handle messaging automatically, sometimes you need to send messages directly from your handler. The conversation.send() method gives you full control over what gets sent.

Sending a text message

Message types

The available message types depend on which channel your agent is deployed on. For Webchat, the following types are supported: Other channels (Slack, WhatsApp, Telegram) may support different message types. When you specify a channel on your conversation, TypeScript will only allow the message types that channel supports.

Examples

Card with actions

Choice buttons

Markdown

Typing indicators

The framework automatically starts a typing indicator when your handler begins and stops it when the handler finishes. You don’t need to manage this yourself. If you need manual control (e.g., you stopped typing to send a message and want to restart it before a slow operation), you can call the methods directly:

Conversation tags

Read and write metadata tags on the conversation:
Tags must be declared in agent.config.ts under conversation.tags. Check out our guide to configuration your agent for more information.

Loading a conversation by ID

You can send messages to any conversation, not just the current one:
This is useful for cross-conversation notifications or broadcasting messages.

Combining with execute()

A common pattern is to send a direct message before or after handing control to the AI:
Direct sends and AI-generated messages appear in the same conversation.
Last modified on April 27, 2026