How to Create a Scenario Section?
When you need to organize a complex scenario into separate logical blocks, creating sections allows better structuring the scenario and simplifying its maintenance. This instruction will help create a new section and configure transitions between sections.
When Needed
- You need to divide a large scenario into logical blocks (for example, "Registration", "Support", "Payment").
- You need to create a sub-scenario that can be called from various places in the main scenario.
- You need to organize complex logic with many transitions and conditions.
What's Important to Know
- Section — logical block of a scenario that contains a set of nodes and has entry points (Entry Point) and exit points (Exit Point).
- Starting section — section from which scenario execution begins when the bot starts.
- Entry Point — node that marks the entry point into the section (there can be multiple Entry Points in one section).
- Exit Point — node that marks the exit point from the section (there can be multiple Exit Points in one section).
Prerequisites
You are logged in with integrator or administrator rights. You have an open scenario editor for the bot. You know what logic the new section will contain.
Step-by-Step Instructions
1. Open Sections Panel
- In the scenario editor, find the sections panel at the top of the screen.
- The panel displays a list of all existing scenario sections.
2. Create New Section
- In the sections panel, click the "Add Section" or "Create Section" button (usually a button with a "+" icon).
- In the modal window, enter the section name (for example, "User Registration").
- Optionally add a section description for better understanding of its purpose.
- Click the "Create" button — the new section appears in the sections list.
3. Navigate to New Section
- In the sections list, click on the new section name.
- The canvas automatically updates and displays an empty section (or section with basic nodes if they were created automatically).
4. Add Entry Point
- On the canvas, add a node of type "Entry Point" (Section Entry Point).
- This node marks the place where section execution begins.
- A section can have multiple Entry Points for different entry points.
5. Add Exit Point
- On the canvas, add a node of type "Exit Point" (Section Exit Point).
- This node marks the place where section execution ends.
- Connect the Exit Point to the last node of the section through an edge.
- A section can have multiple Exit Points for different completion options.
6. Build Section Logic
- Add necessary nodes between Entry Point and Exit Point:
- Messages for the user.
- Keyboards with buttons.
- Input wait for data.
- Actions and other logic elements.
- Connect all nodes through edges in the correct sequence.
7. Set as Starting Section (if needed)
- If the new section should be the starting section (entry point to the scenario):
- In the sections list, find the new section.
- Click the star icon or select the "Set as Starting" option.
- The system automatically sets this section as the starting section.
8. Configure Transitions Between Sections
- To transition from one section to another:
- In the source section, add an Exit Point and connect it to the last node.
- In the target section, make sure there is an Entry Point.
- In Exit Point settings, select the target section and Entry Point for transition.
- Alternatively: in keyboard button or action settings, select the target section and Entry Point.
9. Save Changes
- Check the section structure on the canvas.
- Click the "Save" button at the bottom of the screen or use keyboard shortcut
Ctrl+S(orCmd+Son Mac). - The system saves all changes in the section.
What Happens After
The new section is created and ready to use. You can switch between sections through the sections panel and configure transitions between them. The section becomes part of the overall bot scenario.
How to Verify It Worked
- Check that the section appeared in the sections list at the top of the screen.
- Make sure Entry Point and Exit Point are added correctly.
- Try navigating to another section and back — the structure should be preserved.
- Check transitions between sections — they should work correctly.