Version: Latest

What is a flow in CALM

In Rasa’s CALM approach, flows are the foundational units of an assistant’s functionality. Each flow represents a distinct task or goal that a user wants to achieve, broken into manageable steps. Think of flows as the functional modules of your assistant - each designed to accomplish a specific purpose.

The Role of Flows in Your Bot

At their core, flows help to:

  • Organize business logic: They break down your assistant’s logic into discrete, manageable tasks, such as freezing a card or adding a payee.
  • Improve modularity: Each flow focuses on one task, making it reusable, easy to understand, and simple to update.
  • Support dynamic conversations: While flows are fixed sequences of steps, they incorporate features like conditional branching, slot updates, and subflow calls, enabling them to adapt to real-time input and context.
  • Simplify assistant design: Unlike rigid flowcharts that attempt to map every possible conversational path, flows focus on the logical steps necessary to complete tasks.

How to Approach Flows

Flows aren’t rigid scripts or static paths—they’re structured sequences of steps designed to accomplish specific goals while dynamically handling user inputs and conditions. Here’s how to approach flows effectively:

1. Think in Terms of User Goals

Each flow aligns with a specific intent or goal a user wants to achieve. For example:

  • A user saying, “I need to freeze my card,” triggers the Block Card flow.
  • A user asking, “What’s my balance?” activates the Check Balance flow.

By focusing on user goals rather than technical details, flows stay aligned with what users care about most.

2. Break Business Logic into Small, Manageable Flows

Avoid creating large flows that handle too many tasks. Instead, segment logic into smaller, more focused flows. For example:

  • A Transfer Money flow might link to an Add Payee flow if the recipient isn’t already set up.
  • A Block Card flow might include fraud detection but redirect to a separate Fraud Investigation flow for advanced actions.

This modular approach simplifies debugging, improves reusability, and keeps the assistant design clear.

3. Leverage Structured Flexibility

While flows follow a predefined sequence of steps, they are enhanced with:

  • Conditional branching: To dynamically adjust steps based on slot values or user inputs.
  • Reusable subflows: To modularize shared tasks, such as calling the Authenticate User flow before executing secure actions.
  • Dynamic slot management: To store, reset, and update user-provided information throughout the conversation.

These features ensure that even fixed flows remain contextually aware and adaptable to real-time interactions.

4. Focus on Tasks, Not Paths

Flows prioritize the logical steps needed to achieve a goal, rather than exhaustively mapping every possible path. For instance:

  • The Block Card flow includes steps like selecting the card and confirming the reason for freezing.
  • If a user changes their mind mid-task (“Actually, I don’t want to freeze my card”), the assistant dynamically links to other flows or fallback mechanisms to handle detours.

Benefits of Organizing Logic with Flows

1. Clarity

Each flow serves one specific purpose, making it easier for teams to understand and collaborate.

Example: The Check Balance flow retrieves and displays account balances, while the Block Card flow focuses solely on freezing a card.

2. Scalability

Flows make it easy to grow your assistant’s capabilities without disrupting existing logic.

Example: Adding a new Replace Card flow doesn’t interfere with other flows like Block Card or Check Balance.

3. Modularity

Flows can be reused across multiple scenarios, reducing duplication and effort.

Example: An Authenticate User flow can be called by various tasks, such as checking balances, transferring money, or blocking a card.

4. Maintainability

Isolating logic in flows simplifies debugging and updates.

Example: If there’s an issue with the Add Payee flow, you can refine it without affecting other flows.

Conclusion

Flows in CALM represent a paradigm shift in conversational AI design. By modularizing business logic into clear, task-oriented frameworks, flows ensure assistants are flexible, scalable, and user-focused. Whether it’s handling tasks like Add Payee, Block Card, or Check Balance, well-structured flows deliver seamless, goal-driven experiences. Focus on building adaptable, modular flows to unlock the full potential of CALM.