Stella Platform Documentation

Stella Platform Documentation

  • Docs
  • Procedures
  • Reference
  • FAQ
  • Bot API
  • API
  • Languages iconEnglish
    • 中文

›Common Use Case Application

Get Started

  • Build your First Chatbot

Basic Facebook Chatbot Setup

  • Overview
  • 1.1: Connect to Channels
  • 1.2: Create New Tree
  • 1.3: Build the First Node
  • 1.4: Create a Global Node
  • 1.5: Build Child Nodes
  • 2.1: Production Channel
  • 3.1: Draft a Post
  • 3.2: Create Comment Reply

Basic Instagram Chatbot Setup

  • Overview
  • 1.1: Connect to Channels
  • 1.2: Create New Tree
  • 1.3: Build the First Node
  • 1.4: Create Global Node
  • 1.5: Build Child Nodes
  • 2.1: Create Story Mention
  • 2.2: Create Comment Reply
  • 2.3: Send Push Message

Basic Web Chat Chatbot Setup

  • Overview
  • 1.1: Connect to Channels
  • 1.2: Create New Tree
  • 1.3: Build the First Node
  • 1.4: Create a Global Node
  • 1.5: Build Child Nodes

Basic WhatsApp Chatbot Setup

  • Overview
  • 1.1: WABA Subscription
  • 1.2: Connect WABA
  • 1.3: Check Approval Status of WABA
  • 1.4: Setup WABA with Used WhatsApp Number
  • 1.5: Reset / Terminate WABA
  • 2.1: Create New Tree
  • 2.2: Build the First Node
  • 2.3: Create a Global Node
  • 2.4: Build Child Nodes
  • 2.5: Connect to Datasource
  • 3.1: Create Priority Group
  • 4.1: Create Product Message

Common Use Case Application

  • Overview
  • 1.1: Apply Fail-Safe to Chatbot
  • 1.2: Apply Member Unsubscription Flow to Chatbot

Advanced Chatbot Application

  • Overview
  • Apply Datasource to Chatbot
  • Apply Payload Value to Chatbot
  • Apply API to Chatbot
  • Apply Custom Locale to Chatbot
  • Apply Opt-in Flow to Chatbot
  • Apply Agenda to Chatbot
  • Apply Stella API to Chatbot
  • Apply Web Event to Webchat Chatbot

Error Handling

  • Handle Errors for Chatbot

Stella Partner Portal Setup

  • Overview
  • 1.1: Partner Portal Setup
  • 1.2: New Customer Onboarding
  • 1.3: WABA Setup
  • 1.4: Check Approval Status of WABA
  • 1.5: Setup WABA with Used WhatsApp Number
  • 1.6: Reset / Terminate WABA

Template Tree

  • Overview
  • Create Template Tree
  • Manage Proxy Tree

Chatbot Testing & Deployment

  • Overview
  • Stage One - Tree Building
  • Stage Two - Testing Stage
  • Stage Three - Production Deployment

Slack Live Chat Tree Setup

  • Overview
  • 1.1: Create Tree for Live Chat Assignment
  • 2.1: Set Up Pick Ticket Status
  • 2.2: Create Done Command
  • 2.3: Create Transfer Command
  • 2.4: Create Archive Function
  • 2.5: Create Member Tagging/Remarks Command
  • 3.1: Automatic End Live Chat Function

Zendesk Live Chat Tree Setup

  • Overview
  • 1.1: Create Tree for Assignment
  • 2.1: Create Done Command
  • 2.2: Auto End Live Chat Function

FAQ Chatbot Setup

  • Overview
  • 1.1: Exact Keyword Match
  • 1.2: Keyword Groups Match & Diversion
  • 2.1: Redirect to Existing Chatbot Tree
  • 2.2: Data Analytics for FAQ Chatbot
  • 2.3: NLP for FAQ Chatbot
  • 3.1: Filtering Questions for FAQ Chatbot

NLP Chatbot Setup

  • Overview
  • 1.1: Apply NLP to your Chatbot
  • 2.1: Set Up an NLP Fallback Tree
  • 3.1: NLP Fallback to Other Languages

Connect Shopify Store to Stella

  • Overview
  • 1.1: Integrate Stella to Shopify
  • 2.1: Setup Facebook Messenger Chatbot for Shopify
  • 2.2: Setup WhatsApp Chatbot for Shopify
  • 2.3: WhatsApp Customer Care Notification for Shopify

Stella Inbox Setup

  • Overview
  • 1.1: Connect Channel to Slack
  • 1.2: Access Control & Admin Panel
  • 1.3: Set up Customizable Message
  • 1.4: Inbox Channel
  • 2.1: Turn on Live Chat Directly
  • 2.2: End Live Chat Mode
  • 2.3: Ticketing
  • 2.4: Manage Ticket Helper
  • 2.5: Add Member Tag
  • 3.1: Send Chatbot Message

Apply Fail-Safe to Chatbot

Introduction

While interacting with a chatbot, customers are always asked to reply with text. What should the chatbot do when the customer types a wrong answer?

Fail-safe is a feature that you can apply to your chatbot flow. When it identifies text response that does not match with any of the required answers, it can redirect your customer to the previous node or the live chat support.

Before jumping into this session, you need first learn about Node to Match and Priority.

Node to Match & Priority

In a conversation flow, when the user goes from one node to another, there is a process called node matching. In default, the following child nodes are matched randomly.

For example, node A has a keyword trigger of "Hello" and node B has a any text trigger. If the user types "Hello", the probability of triggering node A or B is 1/2.

However, we can control the order of node matching by changing the priority. In default, every node's priority is 0. Smaller priority value means higher priority. Nodes with the same priority are still matched randomly.

For example, if node A's priority is 0 and node B's priority is 2, then node A will be matched first. Node B will only be matched if node A's trigger cannot be matched.

Therefore, fail-safe usually has the lowest Priority in a tree. As a bot designer, you only want the fail-safe to be triggered when all the other nodes cannot be matched with user's input.


In general, you can apply Fail-safe in 3 ways:

  • Fail-safe Tree Node
  • Fail-safe Global
  • Fail-safe Loop

What is your Result?

Result 1 : Fail-safe in Tree Flow

In this part of the tree flow, the chatbot asks the customer to input "1", "2" or "3". The Fail-safe tree node is able to recognzie the wrong answers, and offers redirecting options for custoemr.

Result 2 : Global Fail-safe

The global fail-safe can be triggered at any point of the conversation flow. Even there is no fail-safe tree node following the "Check Discount" node, the customer is still redirected to the main menu when he inputs unrelated words.

Result 3 : Fail-safe Loop

What if the customer keeps typing the wrong answers? The fail-safe loop can keep asking the customer for redirection options until they input the correct answer.

Sample Tree Structure

Getting Hands On

Apply Fail-safe in a Tree Flow

In this example, a customer can type 1, 2 or 3 to select a service, they can continue with the expected flow if they type the correct answer. The fail-safe tree node will be designed to catch the wrong input from the customer, and tell them to follow the instructions.

  1. Create a new tree node under "Get Started", and name it as "fail-safe".
Create Fail-safe tree node

Create Any Text Trigger

  1. Create a new trigger. Select "Preefined Trigger", then select "Any Text". Then this node will be triggered by any text input by the customer.
Create Any Text Trigger

Create Fail-safe Response

  1. Create a new response for customers who input irrelevant texts. In this example, we invite the customers to talk to our customer support.
Create Fail-safe Response

Change Priority

  1. Inside the tree, there are 4 nodes at this level, so you can change the Priority of Fail-safe node to "4", while other three remains as "0". By applying this, the chatbot will first match the text with the other three nodes. If the answer does not match with any of their triggers, it will enter the fail-safe node. Then, save this node.
Remember that higher priority value stands for lower priority. Usually, a fail-safe node should have the lowest priority in a tree. It will be matched last when all the other text trigger cannot be matched.
Change Priority

Redirect to Another Node

In a fail-safe node, the best practice is to include a follow-up question. Besides, you can also redirect the customer back to the previous step in the conversation flow.

  1. In the Fail-safe node, you have a follow-up question. So create 2 tree nodes called "Yes" and "No" under your Fail-safe node.

  2. In the "No" node, create a trigger and response if the customers do not want to talk to the customer support.

Don't Redirect to Customer Support
  1. In the "Yes" node, create a trigger and response if the customers want to talk to the customer support. Then Redirect the customers to the node for customer support.
Redirect to Customer Support
  1. Check and see if you can produce the expected outcome #1.

Apply Fail-safe Globally

Instead of applying Fail-safe to a particualr session of your tree, you can create a Global Fail-safe and redirect the customers to a node, for example the main menu of your service.

  1. Create a global node, name it as "Fail-safe Global".

  2. Create a new trigger. Select "Preefined Trigger", then select "Any Text". Then this node will be triggered by any text input by the customer.

Create Any Text Trigger
  1. If the customers provide wrong answers at any node, it will redirect the customer back to the "Get Started" node, where the main menu of service is located at.
It is not necessary to redirect to the first node of your tree. Your fail-safe node can redirect to any other point of the conversation flow which you deem reasonable, for example, the main menu or the previous step.
Redirect to Main Menu
  1. As you only want the Fail-safe Global to be triggered when the chatbot is unable to match the answer with any of the triggers in the whole tree, you need to set up a larger Priority number for it. Let's set it to "13" since there are 13 nodes in this tree.
Remember that higher priority value stands for lower priority. Usually, a fail-safe node should have the lowest priority in a tree. It will be matched last when all the other text trigger cannot be matched.
Change Priority
  1. Check and see if you can produce the expected outcome #2.

Fail-safe Loop

If your Fail-safe has a follow-up question, you can set up a Fail-safe Loop, which is a fail-safe for the previous fail-safe. By setting up an additional Fail-safe on top of the previous one, this Fail-safe Loop will keep telling the customer to retry until they input the correct answer.

  1. Follow step 1 to 4 to create a new Fail-safe node if you don't have any.

  2. Create new nodes under the Fail-safe node as redirecting options. You can take reference from step 5 - 7.

Create Fail-safe
  1. Create another new node under Fail-safe node, name it "Fail-safe Loop".
Create Fail-safe Loop Node
  1. Create any text trigger just like step 2. And change the Priority to "3" as there are 3 nodes at this level.
Create Fail-safe Trigger & Priority
  1. Then redirect this node back to the previous Fail-safe node to form a Fail-safe Loop.
Redirect to Fail-safe
  1. Check and see if you can produce the expected outcome #3.

Advanced

To refine the conversation flow and improve the user experience, you can also apply an advanced version of fail-safe.

We have introduced Fail-safe Global and Fail-safe Loop in the previous session. However, trapping a user in a fail-safe loop might not be the best practice for a fail-safe design. Instead, you can decide a condition to stop the loop, and redirect the user to another node, e.g. live chat support.

You can design a fail-safe flow to count how many times a user has entered the fail-safe node, when the count reaches a particular limit, the fail-safe node can automatically redirect the user to the customer support.

Expected Result

The user will go through the standard fail-safe flow when he first enters tha fail-safe node. However, the user will be redirected to the customer support when he enters the fail-safe node two times in a row.

Expected Result

Sample Tree Structure

Advanced Fail-safe Sample Tree

Fail-safe node and Global

  1. First, create a fail-safe tree node under "Get Started". Create an "Any text" trigger and lower the priority. When the user inputs the incorrect answer, redirection options will be given to him.
Fail-safe Tree Node
  1. Create a fail-safe global node, set the priority to be the lowest and set up an "Any text" trigger. In the sample tree, the priority of this node is 50, it will cover all the unmatched input and redirect the users to the fail-safe tree node.
Fail-safe Global

Fail-safe Count

  1. In "[Main Flow] Fail-safe", create a pre-action.

  2. Enter the following code. This pre-action will count how many times a user has entered this node. The count will be saved in member's tempData.

return new Promise((resolve) => {
  // console.log("in Save Number of Fail Safe")
  // console.log("member", this.member)
  // console.log("node", this.node)
  // console.log("get failSafeAgain", this.member.failSafeAgain)
  let numberOfFailSafe = this.member.botMeta.tempData.numberOfFailSafe || 0
  // console.log("numberOfFailSafe before increment", numberOfFailSafe)
  if ((this.member.botMeta.tree === this.node.tree && this.member.botMeta.nodeCompositeId === this.node.compositeId) || this.member.failSafeAgain) {
    this.lodash.set(this.member, "botMeta.tempData.numberOfFailSafe", numberOfFailSafe + 1)
  } else {
    this.lodash.set(this.member, "botMeta.tempData.numberOfFailSafe", 1)
  }
  // console.log("numberOfFailSafe after increment", this.member.botMeta.tempData.numberOfFailSafe)
  resolve({
    member: this.member
  })
})
Fail-safe Count Action

Transformed Response

  1. When the user has entered the fail-safe node multiple times in a row, we don't want to display the original response.
Fail-safe Response
  1. Click on "Advanced", enter the following code. this.member.botMeta.tempData.numberOfFailSafe is the count of how many times has a user entered the fail-safe node. If the count is less or equal to 1, the original response will be displayed. If the count is greater than 1, this response will be displayed.
return new Promise((resolve) => {
  if (this.member.botMeta.tempData.numberOfFailSafe <= 1) {
    resolve({
     <RESPONSE>
    })
  } else {
    resolve()
  }
})

You can copy the original response from "Response Object" and paste it into the code.

Transformed Response

Advanced Redirect

  1. You need to decide where the user should be redirected to when the fail-safe count is larger than 1.

  2. In "[Main Flow] Fail-safe", create "Advanced Redirect". Enter the following code, and the user will be redirected to a specific node when the count is larger than 1. You can also adjust the count requirement by changing the count number in this.member.botMeta.tempData.numberOfFailSafe > 1.

return new Promise((resolve) => {
  if (this.member.botMeta.tempData.numberOfFailSafe > 1) {
    resolve({
      tree: this.node.tree,
      nodeCompositeId: <COMPOSITE_ID>, //Customer Support
    })
  } else {
    resolve()
  }
})

Please remember to input the Composite ID of the node being redirected to.

Advanced Redirect

Reset Fail-safe Count

  1. Apart from those, you also need a global node to reset the fail-safe count when the user enters another tree node except the fail-safe node. So the count only works with the fail-safe node.
Clear Fail-safe Count
  1. Create a "Trigger", and create a new "Condition" using the following code. This node will be triggered when a user enters any other node except for "[Main Flow] Fail-safe". As a result, the count will only accumulate when the user keeps re-entering the same fail-safe node.
this.member.botMeta.nodeCompositeId !== <FAIL_SAFE_COMPOSITE_ID> && this.member.botMeta.tree !== “TREE_ID”

Please remember to enter the Composite ID of the Fail-safe tree node and the Tree ID.

Clear Fail-safe Count
  1. Enter the following code to create a new "Action". It will clear any existing fail-safe count for a user.
return new Promise((resolve) => {
  this.lodash.set(this.member, "botMeta.tempData.numberOfFailSafe", 0) 
  resolve({
    member: this.member
  })
})
Clear Fail-safe Count Action
  1. Check and see if you can produce the expected result.
← Overview1.2: Apply Member Unsubscription Flow to Chatbot →
  • Introduction
    • Node to Match & Priority
  • What is your Result?
    • Result 1 : Fail-safe in Tree Flow
    • Result 2 : Global Fail-safe
    • Result 3 : Fail-safe Loop
  • Sample Tree Structure
  • Getting Hands On
    • Apply Fail-safe in a Tree Flow
    • Apply Fail-safe Globally
    • Fail-safe Loop
  • Advanced
    • Expected Result
    • Sample Tree Structure
    • Fail-safe node and Global
    • Fail-safe Count
    • Transformed Response
    • Advanced Redirect
    • Reset Fail-safe Count
Stella Platform Documentation
Docs
Get StartedBot API ReferenceAPI ReferenceStandard Procedures
Community
FAQUser ShowcaseChat with Us
Copyright © 2023 Sanuker Inc. Limited