Adding your Actions allows you to make a trigger of programmatic function in the external applications based on end-user expressions and send dynamic responses back to the end-user or even start a chain of making API calls based on rules and conditions. For example, if an end-user wants to get a balance in SAP, your Action can check the SAP database and respond to the end-user with the balance for some particular account.
Each skill node has a settings to enable Actions. If a skill node requires to trigger a programmatic function in an external application, you should allow Action for the node.
The following diagram shows an example that uses action in integration with external application.
The end-user asks for information about the balance in the backend system.
Hala matches the user input with the intent
intent.get_balance, and then search for the root nodes that include the condition
Based on the response configuration in the founded node, Hala responds to the user and asks for additional information.
The end-user responds "1000".
Hala matches the user input with the
entity.company_id, and searching for the child nodes that have the condition
entity.company_id. The node configuration includes the activated Action "SAP Get Balance" and response. Based on this configuration, Hala will make the API call for the selected action and do not send the response to the end-user.
The external application performs a programmatic function based on import parameters from Hala and then sends the response back to Hala.
To evaluate the response from the external application, you need to specify the context variable in the child node condition. In the current example, the API response will be stored in context
context.SAP.response. Also, the child node has a response setting. As a result, Hala will send the response to the end-user.
After the system performs the necessary database queries, Hala provides the balance for the requested account.
When you are creating your skill nodes, you can see the section with Actions, and you can select the actions that you have created upfront on the page Actions.
When you will select the action, you will see the technical parameters of the Action (API). You can change the values for the parameters from the skill node interface.
Here is an example of added action into the skill node. You can add as many actions as you want (be sure that you will store the response from the Action in a unique context variable).
Be default the response from the Action (API) will be stored in a context variable
context.actionResult, you can change the name of the context variable to the name that meets your goals with this Action. For example, if you want to make the action in the SAP, you can name the context variable like
More information about the actions here: Actions