Skip to main content
Actions are callable functions that can be invoked by workflows, conversations, or other actions. They encapsulate reusable logic and can be called from anywhere in your agent.

Creating an action

Create an action in src/actions/:

Action input and output

Define input and output schemas using TypeScript types or Zod schemas:

Calling actions

Actions can be called from anywhere in your agent’s source. Just import actions and call them directly:

As a tool in a conversation

You can provide an action to your agent as a tool using the asTool method:

Integration actions

When you install an integration, its actions become available anywhere in your agent’s source:

Best practices

  • Keep actions focused on a single responsibility
  • Use actions for reusable logic that’s needed across multiple parts of your agent
Actions are ideal for business logic that doesn’t need to be part of the conversational flow. They can be tested independently and reused across different parts of your agent.

Reference

Action props

Handler parameters

The handler function receives an object with input and client properties: