Dynamic Workflow Node

Updated 

Before You Begin

This node is part of Sprinklr AI+. Enable this node by raising a support ticket at tickets@sprinklr.com.

Overview

The Dynamic Workflow Node is a pivotal component in a chatbot's dialogue tree, designed to enhance the chatbot's conversational capabilities and create more human-like interactions. This GPT-powered node efficiently bifurcates intents/entities, collects customer inputs, and processes data to generate responses within a single dialogue tree, eliminating the need for multiple trees with different bot replies.

You can also enable context switching. For more information, see Context Switching.

To Configure the Dynamic Workflow Node

  1. Click the Addition icon within your dialogue tree and select Dynamic Workflow.

  2. Enter a Name for the node as per your use case.

  3. Define the Workflow Goal in the pop-up window to outline your use case. The goal serves as the guidelines for Gen AI to achieve the desired outcome for your bot. You can specify the information to be captured by the bot and incorporate variables and custom fields using the resource picker to create a dynamic workflow. Additionally, you can utilize Sprinklr AI+ to generate a workflow goal.

    Best Practices

    - Define a persona for the bot

    - Explain what each of the variables mean

    - Handle fallback scenarios like transfer to agent using hardcoded functions

    - Define prompt guardrails to ensure the bot only does what it is instructed to do.

    - For assistance, refer to resources like OpenAI's Cookbook and OpenAI's Prompt Engineering Guide for a more comprehensive understanding of prompt engineering.

  4. Next, include the user inputs necessary for the bot to gather information.

    Display Name: This name is used by Sprinklr AI+ to understand what this variable means and what kind of data it will store. Make sure that the Display Name is intuitive for GPT to understand.

    For instance, if the bot is assisting with an address change and requires details such as Product ID and House Number, add two inputs with associated variables (e.g., "Prod_ID" for Product ID and "House_Number" for House Number) to store this data. You can also designate them as mandatory.

    Variable: This variable is created within the Dialogue Tree to store the collected information and to be used later in the flow. Ensure that this variable name is in accordance with Sprinklr DT variable naming conventions.

    - Variable name should consist of only letters (A-Z)/(a-z), digits (0-9) and _

    - Variable names are case sensitive

    - Variable names should not start with digits

    Format: This field helps Sprinklr AI+ understand the format in which data needs to be stored. For instance, if you need a PNR number to check the flight status, you can define the format as a 6-digit alphanumeric code. If the user input doesn't match the specified format, the bot prompts the user with an invalid reply message and requests them to provide the correct input.

    Required (Checkbox): This helps Sprinklr AI+ understand whether this is a mandatory or a non-mandatory field. The Dynamic Workflow node will not exit successfully unless it has all the mandatory inputs.

    (Note: The bot will exit with an error state if it does not receive any of the mandatory inputs for 2 consecutive tries.)

  5. Click Save to save the node.

    Note: Raise a support ticket to request changes to the backend prompts and ensure that the chatbot's interactions align with your branding, messaging, and user experience objectives.

Additional Functions

There are specific hardcoded functions which are triggered based on Bot Replies published by the dynamic workflows. They can be used to manage its behavior during user interactions.

BOT_COMPLETED: Whenever the Dynamic Workflow node tries to publish this exact text, it is blocked by our backend functions and the bot workflow exits successfully from this node. This can be helpful to exit the node whenever a certain set of conditions are met during the bot conversation. It can also be used to create or assign values to local variables upon exit by defining it in a JSON format.

For example:

You want to collect 6-digit PNR from the user. In the case where the user does not want to talk to a bot and wants to continue with an agent, the Dynamic Workflow node will be confused and not know how to proceed with the request. Here, we can direct the node in the prompt itself, “Whenever user asks for an agent, reply “BOT_COMPLETED {“agent_flag”:true}”. This command will help the node successfully exit the node, setting the variables as instructed in the JSON.

BOT_ABORT: Similarly, the node can reply with "BOT_ABORT" in situations where the conversation abruptly ends due to specific conditions or errors detected during the interaction. For example, if the user's input is unclear or invalid, you can set up the bot to abort and exit the dynamic workflow node. The DYNAMIC_CHAT_ERROR is a backend system variable that is automatically set to true whenever the bot unexpectedly aborts.