Create Action
Create actions folder
Locate the your app folder in the apps directory and add a new actions
folder if it doesn't exist already.
Create action file
Create a new file within your app's action folder. Make sure it ends with .action.ts
.
Add your own values. We provided mock data to help initialize the process.
-
export const newAction = createAction
- Replace newAction with the name of your action.
-
Add an id:
your-new-app_action_new-action
- Make sure the id follows the format
<app-id>_action_<action-name-in-kebab-case>
- Make sure the id follows the format
-
Add a name for your action
-
Add a brief one sentence description
-
Add an AI Schema
This is a zod schema used for AI to "fill out" the form to configure this action.
Read more about the AI Schema.
-
Add an Input Config
This is used to generate the form for the UI to configure this action.
Read more about the Input Config
-
Define the
run
function.This is the function that runs during workflow steps or when an AI agent uses this action as a tool. Whatever is returned from this function can be used in subsequent steps in the workflow or by an AI agent.
The common arguments used by this function are
configValue
andconnection
.-
configValue
represents the Input Config or AI Schema that was used when the user or AI agent configuring this action. -
connection
is the decrypted connection properties of the connection selected by the user when configuring this action. May contain an api key, accessToken, username & pass, or key pairs.If using an oauth2 connection, do not worry about handling refresh tokens, that is handled by the engine. Just make the api call assuming the access token is valid.
-
-
Define the
mock
function.The
mock
function is used by users when they want to generate a mock output instead of making an real api call to their third party integration.Ouput data is used to map to other nodes in the workflow builder. This is done by clicking
Save & Test
in the configuration form.