Run Workflow step in a Conversational Assistant

Sometimes Business rules in Kustomer can’t catch all first inbound interactions because Business rules don’t run while a Conversational Assistant is running. So when a chat is opened any business rules that trigger on first inbound interaction will not trigger. Business rules run after the conversational assistant finishes executing all their associated rules and by then the Initial-in message is already on the conversation. So we can use a Run Workflow interaction in our Dialog from the conversational assistant.

Scenario: adding a note triggered off first inbound interaction conditions

In our scenario we’ll place a note on a conversation based on some customer attributes we evaluate and the event will trigger on the first inbound interaction, the initial-in message. And since this won’t catch chats, we’ll use the Run Workflow step to do the job for the chat channel!

How to add the Run Workflow step to your conversational assistant

The Run Workflow object is only available in the “Assistant starts from here” section, not the “Dialog continues to” section

By clicking on the the Add Interaction link in the Assistant starts from here section provides the opportunity to select Run Workflow

If you click in the Dialog continues to section you will not see the Run workflow option

The placement of the Run workflow step is vitally important based on what your scenario calls for. In our scenario we need to check the customer's company affiliation to see if a note needs to be added for special instructions in dealing with a specific company and their employees. So we have to place our Run workflow step after we’ve collected the appropriate information to identify the customer. We’ll use email as the identifier for this scenario. We’ll also need to pass the conversation ID to the workflow so we know what conversation to which we want to add the note. Your specific requirements will guide you to where to place your Run workflow step.

Build the workflow

Now that you know where you want to place your workflow in your conversational assistant dialog flow and you’ve determined what kind of information the workflow needs to process, we need to build the workflow and because we need to pass parameters, we’re going to use a callable workflow! Before we can add the Run workflow object, we’ll need a callable workflow created so that it’s available in the drop-down in the Run workflow object and it’s a good idea to create the callable workflow with the appropriate input parameters. For our scenario we’ve decided we need a callable workflow that receives an email and conversation id.

We’ll also have to send a response after the workflow has completed, our output parameter(s).

We’ll use the input parameter to look up the customer. Then we’ll look up their company and check the condition - is this the right company and if so, add the note!

Once we have the callable workflow in place we need to save it to make it available in the Conversational Assistant.

Select your workflow in the Run workflow object and fill in your parameters

You can now add your Run workflow object to your Conversational Assistant in the appropriate dialog. And now that we have our callable workflow saved, it’ll be available to us in our drop-down.

Once you’ve selected the callable workflow you’ve created for this CA, the corresponding input and output parameters will be made available for you to fill out.

You can see the Input parameters are the ones that your callable workflow is expecting, in our scenario we see we need to provide Email and Conversation Id. To fill in these parameters you can use dynamic text to send values into your callable workflow. In our scenario we need the customer’s email address and the conversation id, using dynamic text.

And it will fill in and send the appropriate values to your workflow

The output parameters are a little different, no dynamic text here. For the output parameter we need to pick a destination in a Klass object for our response. You can create any attribute necessary on Customer or Conversation klasses and use them as your response destination. Select the klass you want and add the attribute that will store the response.

The last thing to account for in the Run workflow object is the action taken if the workflow encounters an error. This will be different from a workflow response which will only happen on a successful execution of the callable workflow. If the callable workflow has an error, you need to redirect the dialog so the conversational assistant can continue. It’s always a good idea to send this part of the flow to a Transfer to an agent step to ensure your customer’s get help!

And this should allow you to catch those first inbound interactions on the chat channel when the business rules don’t trigger and take the actions you need!