Chapter 5

The Workflow

Now that we’ve explained integrations and layered various AI models, the question arises: how can companies effectively use these tools to solve their customer service needs? Typically, they hire customer service agents. So, let's step into their shoes for a moment: How can we, as agents, use the tools at our disposal to help customers?

In any sufficiently large company, agents don’t simply read customer messages and respond based on intuition. They undergo training, read the Service Level Agreement (SLA), and familiarize themselves with company policies. More importantly, they’re given scripts tailored for different scenarios. When an agent picks up a customer service ticket, they identify the problem, refer to the appropriate script that aligns with the company’s brand messaging, and fetch relevant information like order status or shipping details before crafting a reply.

In the case of chatbots, whether communicating through chat, voice, or email, they serve the role of a customer service agent—but with the speed and consistency of a computer. To ensure a chatbot is as effective as a human, it needs something crucial: a script to follow. This script is the chatbot’s rule book, guiding it through the various stages of resolving customer inquiries efficiently.

Defining the Company's Policy

With a chatbot that uses AI to extract context from user messages, integrates with various platforms, and addresses user problems, the final piece we need is a script to orchestrate this symphony.

Every eCommerce business operates under a set of policies that define how they interact with customers and fulfill their commitments. These policies are not just guidelines; they are promises made to customers, and they play a crucial role in how the company responds to customer inquiries.

For example, a company might have the following commitments:

  • Shipping Policy: All purchased items will be shipped within 2 business days.
  • Service Level Agreement (SLA): Orders should arrive within 3 to 5 business days.
  • Return Policy: Items can be returned, no questions asked, within 30 days of purchase.
  • Refund/Replacement Policy: Damaged items reported within the first 10 days can be refunded or replaced. After 10 days, only replacements are offered.

These policies are not part of the AI model’s training. Instead, they are implemented at the application level, as a manual process that ensures alignment with the specific policies of the company. This distinction is crucial because it underscores that the chatbot’s role is to apply these predefined rules consistently, rather than relying on the AI to make decisions based on generalized training data.

For instance, if a customer asks for tracking information 10 minutes after placing an order, the AI isn’t making an arbitrary decision. Instead, the application applies the company’s shipping policy: "Your order is currently being processed and should ship within 2 business days. Once it ships, you’ll receive an email with the tracking information."

By embedding company policies into the application’s logic, you ensure that customer interactions are consistent and aligned with your business's commitments. This process requires manual configuration to match the company’s specific rules and policies, ensuring that the chatbot’s responses are accurate and reliable.

These policies can be structured into a decision tree that guides the chatbot’s responses for different scenarios:

  • Order Status Inquiries: If a customer asks about their order before it’s shipped, the chatbot refers to the processing time. If it’s within the SLA window, the chatbot provides reassurance that the order is on track. If it’s beyond the SLA, the chatbot can escalate the issue or provide a more detailed explanation.
  • Return Requests: When a customer requests a return within the allowed 30-day window, the chatbot can immediately initiate the return process. If the request comes after 30 days, the chatbot might offer alternative solutions, such as store credit or an exchange, based on the company’s policy.
  • Refund or Replacement for Damaged Items: The chatbot can automatically check the date of the order and, if within the first 10 days, offer a refund or replacement. If it’s after 10 days, the chatbot follows the policy by offering only a replacement.

Integrating these policies into the chatbot at the application level, rather than through AI model training, not only ensures compliance but also enhances the customer experience by providing clear, consistent, and policy-driven responses. This reduces ambiguity, prevents potential disputes, and aligns the chatbot’s behavior with the company’s values and commitments.

Teaching the Chatbot the Rules

To ensure the chatbot can serve customers effectively, we need to convert the company’s rules and processes into a functional, step-by-step script that it can follow. When a customer reaches out, whether to track an order, ask for a refund, or inquire about a product, the chatbot must respond as if it were a trained human agent. This is where scripting comes into play.

Let’s take the example of a customer wanting to track their order. Once the chatbot identifies that intent, it triggers the Track Order Script, which consists of a series of actions represented by nodes. Each node represents a specific step the chatbot takes in resolving the issue. Together, these nodes form a logical workflow to guide the chatbot’s response. Let’s break down some of the different types of nodes:

  • Integration Nodes: These are the most critical when interacting with external systems like eCommerce platforms or carrier services. For example, an integration node will fetch order details or retrieve real-time tracking information from a shipping provider.

  • Condition Nodes: These nodes evaluate specific criteria to determine the next course of action. In our Track Order example, a condition node could check whether the order was placed within a certain timeframe and compare it against the company’s Service Level Agreement (SLA). Depending on the outcome, the chatbot will decide how to proceed—whether to notify the customer of a delay or continue processing.

  • User Input Nodes: Often, additional information is required to process a request. If the chatbot cannot find an order based on the customer’s email, for instance, it can use a user input node to ask for missing details like the order number.

  • Handoff Nodes: Not all customer issues can be solved by the chatbot. When it encounters a situation beyond its capabilities, a handoff node seamlessly transfers the case to a human agent. This ensures that complex or sensitive issues are escalated for a more personalized resolution.

These nodes allow us to craft a company-specific script for each customer intent we aim to support, such as "Track Order," "Request Refund," or "Product Inquiry." By defining these workflows, we essentially "teach" the chatbot how to handle real-world customer issues efficiently and according to company guidelines.

In Part 2, we will take a more technical approach to explain how this workflow system functions behind the scenes. We’ll dive deeper into how these nodes are constructed, how they interact with integrations and APIs, and how to customize workflows to meet unique business requirements. By then, you’ll have a clear understanding of both the practical and technical elements of building a rule-based chatbot.

← CH04: Artificial Intelligence
CH06: The Core Application →