- Just write your prompt...
- then use the generated Action.

- Make repeated API calls to an external service
- Perform a specific calculation multiple times
- Manipulate data and variables
Actions are code-based, but you don’t need to write the code yourself—AI does all the work based on your prompt.
Overview
Actions are TypeScript functions that execute their code whenever an Autonomous Node calls them. Just like Execute Code Cards, Actions let your bot use custom code. However, they’re different in two important ways:- Actions are only available in Autonomous Nodes—they execute when AI decides they should
- Actions are re-usable—your Autonomous Node can call them as many times as it needs
Create an Action
To create a new Action:- Go to the Actions menu in the Studio.
- Select Create Action.
Generate using AI (recommended)
You can generate the entire Action using AI. In the bottom-left corner, write a prompt that describes what you want your Action to do:

Write code yourself
If you prefer, you can write the Action’s code yourself—just edit the function on the right side of the editor.For more information, check out our guide on using code in Botpress Studio.
Edit your Action’s name/description
Whether you generate your Action with AI or write it by hand, you can edit its name and description. Just select them in the upper-left corner of the editor, then enter a new name/description.Use Actions
When you’re ready to use an Action, you can add it to any Autonomous Node:- Select + Add Card on any Node to open the Card tray.
- Search for your Action, or find it under Bot Actions.
- Add it to the Autonomous Node.
Give your Autonomous Node instructions
If you add an Action to your Autonomous Node, you should add instructions to the Node’s prompt so it knows when to use the Action. For example:Manually provide inputs
By default, the Autonomous Node decides how to fill in the Action’s input fields based on the conversation’s context. However, you can manually fill in these fields if you’d prefer:- Select your Action from the Autonomous Node to open its inspector.
- Select the input field you want to manually fill in, then select Manual.

Schemas
Actions use input and output Schemas to tell your bot what data they expect and what data to return. Schemas are automatically created when you create an Action, and they automatically update when you edit your Action using AI. This means you don’t have to worry about them if you’re only using AI to generate your Action.Use custom Schemas
If you’re writing any of your Action’s code by hand, you can write or select a custom Schema:- In your Action’s editor, select Input Schema or Output Schema.
- Here, you can edit your Action’s default Schema directly, or select a previously-created Schema from the drop-down menu.



