Skip to main content
Actions are reusable functions that hold shared business logic. You can call them from your agent’s code (via conversations, workflows, triggers, tools, or other actions). You can also call them over HTTP from external systems.

Creating an action

Create a file in src/actions/:
Action names must be alphanumeric with no underscores, dashes, or spaces (e.g. calculateTotal, not calculate_total). Browse and test actions from the dev console:
Actions page in dev console

Caching results

Set cached: true to cache an action’s output by its input. Subsequent calls with the same input return the cached result instead of re-running the handler:
This is useful for actions that are pure, perform an expensive calculation, and are called repeatedly with the same inputs.

Calling actions

Import actions from @botpress/runtime and call any action by name. The action’s input and output are fully typed.

From a conversation

From a workflow

From a tool

From a trigger

As a tool

While actions are just functions that can be called from anywhere, tools only exist inside execute() and are called by the LLM. If you want the LLM to have access to a certain action:
  1. Convert it to a tool with .asTool()
  2. Pass it into the tools field:
You should always provide a detailed description that helps the LLM decide when to use a tool. When converting an action to a tool, you can override its description by passing a string into thedescription field:

Integration actions

When you add an integration, its actions are available under actions.<integration>:

Calling from external systems

Actions are exposed via the Botpress Runtime API’s callAction endpoint. External services can call your agent’s actions over HTTP:
This makes actions the bridge between your agent and external systems. A backend service, a webhook handler, or another application can trigger your agent’s logic without going through a conversation.
Last modified on April 27, 2026