Subflow
Overview
Subflows are reusable chatbot flows that can be embedded within multiple areas of a chatbot’s conversation structure. They help simplify complex chatbots by consolidating frequently used sequences into a single, manageable unit.
For example, if multiple chatbot flows require user authentication, a single authentication subflow can handle login verification and be reused across different interactions.
Key Features of Subflows
- Encapsulation: A subflow functions as a standalone unit within a chatbot.
- Reusability: A single subflow can be used in multiple chatbot conversations.
- Entry and Exit Points: Subflows have a designated Entrypoint node where the flow begins and Outgoing nodes that return users to the main chatbot.
- Simplified Maintenance: Updates to a subflow automatically apply to all chatbot flows that use it.
Creating a Subflow
Follow these steps to create a subflow in BotStudio:
- Navigate to the Subflows page under the Advanced tab.
- Click Add New Subflow to create a new subflow entry.
- Click Conversation Flow to enter the subflow editor.
- The Entrypoint node appears as the default starting point.
- Build the subflow as needed, ensuring it serves a single purpose (e.g., authentication, data collection, etc.).
- Define Outgoing Nodes, which serve as exit points back to the main chatbot.
- Click Exit to Main Bot to return to the chatbot’s primary flow.
- Add the subflow to a conversation flow by creating a new child node and toggling Add Subflow.
Using a Subflow in a Chatbot
Once a subflow is created, it can be added to any chatbot flow:
- Open the Conversation Flow page.
- Locate the area where you want to integrate the subflow.
- Add a new child node and select Add Subflow.
- Choose the relevant subflow from the list.
- Define any necessary Outgoing Nodes to specify how the chatbot should transition back to the main flow.
- Save the changes.
Best Practices for Subflows
- Keep subflows focused: Each subflow should handle one distinct function (e.g., authentication, order tracking, feedback collection).
- Use outgoing nodes effectively: Ensure that every subflow has clear exit points leading back to the main chatbot.
- Minimize redundancy: Consolidate repetitive chatbot functions into subflows to maintain an organized and scalable chatbot structure.
- Test subflows separately: Before integrating a subflow, test it independently to ensure it functions correctly.