notice

This is unreleased documentation for Rasa Documentation Main/Unreleased version.
For the latest released documentation, see the latest version (3.x).

Version: Main/Unreleased

Custom Actions

A custom action can run any code you want, including API calls, database queries etc. They can turn on the lights, add an event to a calendar, check a user's bank balance, or anything else you can imagine.

For details on how to implement a custom action, see the SDK documentation. Any custom action that you want to use in your stories should be added into the actions section of your domain.

When the dialogue engine predicts a custom action to be executed, it will call the action server, with the following information:

{
"next_action": "string",
"tracker": {
"conversation_id": "default",
"sender_id": "string",
"slots": {},
"latest_message": {},
"latest_event_time": 1537645578.314389,
"followup_action": "string",
"paused": false,
"events": [],
"latest_input_channel": "rest",
"active_loop": {},
"latest_action": {}
},
"domain": {
"config": {},
"session_config": {},
"intents": [],
"entities": [],
"slots": {},
"responses": {},
"actions": [],
"forms": {},
"e2e_actions": []
},
"version": "version"
}

Your action server should respond with a list of events and responses:

{
"events": [{}],
"responses": [{}]
}