How to Use an Action in a Scenario?
Actions allow extending scenario functionality: integrating with external systems, processing data, executing complex logic. This instruction will help add and configure an action in Scenario Dialog.
When Needed
- You need to send an HTTP request to an external API
- You need to validate data entered by the user
- You need to execute conditional logic (if-else, switch)
- You need to integrate with FastLine Pro AI agents
- You need to create a ticket or perform another system action
- You need to use custom logic created through ActionJail
What's Important to Know
- Action — JavaScript function that executes during scenario execution
- Standard actions — built into the platform (98 actions), available to all bots
- Custom actions — created through the ActionJail module for specific tasks
- Action parameters — settings passed to the action during execution
- Action result — value returned by the action (can be used for conditional transitions)
Prerequisites
You are logged in with integrator or administrator rights You have an open scenario in the Scenario Dialog editor You know which action is needed (standard or custom)
Step-by-Step Instructions
1. Open Scenario Editor
- Navigate to the Dialog module via
Apps -> Dialog - Select the bot and open the scenario for editing
- Make sure you are on the needed scenario section
2. Add Node of Type Action
- On the canvas, right-click or use the "Add Node" button
- In the modal window, select node type "Action" (or "Action")
- The node appears on the canvas — drag it to the desired location
3. Select Action
- Click on the Action node to select it — the editing panel (RightSideBar) opens on the right
- In the "Action Template" or "Action template" field, select the needed action from the dropdown list
- The list contains:
- Standard actions — built into the platform (for example,
action_validate,action_send_request) - Custom actions — created through ActionJail (if they exist in the system)
- Standard actions — built into the platform (for example,
4. Configure Action Parameters
- After selecting the action, a form with parameters appears in the editing panel
- Fill in required parameters (marked with an asterisk
*) - If needed, fill in optional parameters
- Use variables and macros for dynamic values (for example,
{{user_input}})
Example for action_send_request:
- URL — API endpoint address
- Method — HTTP request method (GET, POST, PUT, DELETE)
- Headers — request headers (optional)
- Body — request body (optional)
Example for action_validate:
- Input — value to validate (can be a variable)
- Type — validation type (email, phone, number, text)
- Error message — error message
5. Configure Transitions (if needed)
If the action returns a value for conditional transitions, configure edges:
- Successful execution → connect to the node that executes on success
- Error → connect to the error handling node
- Conditional values → add multiple edges with different conditions (for example, for
if_else)
To configure conditional transitions:
- Select an edge (connection) between nodes
- In the edge editing panel, specify the transition condition (for example,
result === 'success')
6. Save Changes
- Check action settings in the editing panel
- Click the "Save" button at the bottom of the screen or use keyboard shortcut
Ctrl+S(orCmd+Son Mac) - The system saves all changes and shows a success message
What Happens After
The action is added to the scenario and will execute during bot operation. When the bot reaches this node, it will call the corresponding action function, pass parameters, and process the result.
How to Verify It Worked
- Check that the Action node displays on the canvas
- Make sure the action is selected in the editing panel
- Check that all required parameters are filled
- Make sure the node is connected to other nodes through edges
- Try opening the scenario again — all changes should be saved
Common Errors and Solutions
Problem: Action does not execute or returns an error
- Solution: Check if all required parameters are filled correctly, if URL/endpoints for HTTP requests are specified correctly
Problem: Cannot find the needed action in the list
- Solution: Check if the action exists in the system (standard actions are always available, custom ones — only if created through ActionJail)
Problem: Action executes, but result is not processed
- Solution: Check if conditional transitions (edges) after the action are configured correctly
Related Materials
- What are actions and how they work — detailed explanation
- Actions Reference — complete guide to all 98 actions — table with description, configuration, and return values for each action
- ActionJail module — creating custom actions
- Create custom action