Copilot Studio: Dynamic chaining with generative actions (preview)

In previous articles I showed you how you can create plugin actions (currently in preview) in Copilot Studio by using one of the Power Platform connectors, or by using a Power Automate Flow. In this article I am going to discuss how you can use Dynamic Chaining, another preview feature that is part of generative AI capabilities in Copilot Studio. First let me explain what dynamic chaining is. If you read any of the previous articles I mentioned above, then you know that up until now, we still had to create topics in order to call the plugin actions. Yes, it was a lot easier to use a plugin action in a topic vs having to create a custom topic with multiple questions, variables, etc. but the dynamic chaining functionality that is currently in preview will make the process even easier!

What is Dynamic Chaining?

When dynamic chaining is enabled, generative actions will be taking control of the routing of all conversations. This means that when a message is received from a customer, GPT will determine which topic(s) and plugin action(s) need to be called to respond to the query. This changes things significantly! The main difference here is that instead of looking for trigger phrases, Copilot (GPT) will depend on other things to determine which topic(s) or plugin action(s) need to be called. The most important thing to remember here is that GPT will make its decision on things like the description of the topic(s) or plugin action(s), names of inputs and outputs and input and output descriptions, etc. Needless to say, you make sure your descriptions are up to par when you enable this preview feature!
Once the topic(s) or plugin action(s) are selected, Copilot determines in which order these should be run, and ‘chains’ the plugin action(s) and topic(s) together. You can actually see this chaining happen, if you click on the new tracing mode icon on the test bot. When the customer enters a message in the chat, Copilot will try to prefill any inputs that are needed by the plugin(s) and/or topic(s) by identifying values from what the customer entered in the chat. This is something that we were already familiar with, as Copilot does this natively, even without enabling this new preview feature. (Think about a customer mentioning their email address in the chat, before Copilot asked that question. Since the customer provided the email address prior to Copilot asking for it, the question will be skipped, and the email address will be stored in the email variable associated to the skipped question.) When the customer enters a new message into the chat, Copilot (GPT) runs through the same scenario again, where it will identify the topic(s) and plugin action(s) needed, and the order they should be run in.

Enable Dynamic chaining with generative actions (preview)

You can enable Dynamic chaining with generative actions (preview) by navigating to the Generative AI section on the left side of the screen. You’ll need to scroll down a bit in order to see the feature, which is listed under the ‘Use AI features in your Copilot’ heading. Click on the toggle to turn the feature on. Once you enabled the preview feature and navigate to ‘Topics and Plugins’, you’ll notice that any topics with trigger phrases, are now using the Dynamic Chaining triggers. You read that right! All trigger phrases in topics have been replaced by Dynamics Chaining triggers! You’ll also notice that any plugins in Copilot have this trigger enabled. NOTE: If you want to exclude a plugin action from dynamic chaining, you can disable dynamic chaining for the plugin action as shown in the screenshot below.

When you open a topic, you’ll see that below the dynamic chaining trigger is a text field that is labeled ‘describe what the topic does’. Copilot automatically created a description for the topic, based on the related trigger phrases. If needed you can edit the description, so you have the best possible description explaining what the topic does. The best way to create descriptions is to use simple language. The description should be a short summary of the functionality and shouldn’t be longer than 2 sentences. I want to reiterate the importance of the description, since this is the primary piece of information Copilot (GPT) uses when identifying the correct topic(s) or plugin action(s) to respond to a message in a chat.

Example 1

For my example I am going to use the plugin action I created previously. (Check out this article to get the details) . This plugin action ‘Find Contact by Email’ was created by using a power automate flow that queries Dynamics 365 Customer Service for a contact record using the email address that was entered in the chat. If the contact is found, the unique id of the contact record is fed back into Copilot. I created a second plugin action (also from a power automate flow) called ‘Create a case from contact id’ which creates a case and relates it to the contact by using that same unique id (contact id) of the contact record. Before you test this functionality make sure you enable tracing mode in the test copilot window! To start the test, I enter ‘I need my contact id”. I see the ‘Find Contact by Email’ topic in the Dynamic chain log. Copilot asks me for an email address, which it needs to get the contact id from data verse. So far so good! I enter an email address and Copilot feeds the contact id back to me. Then I enter: ‘I need to create a case’. I now see the ‘Create a case from contact id’ plugin action loaded in the dynamics chain log. I also see that the contact id field (input) has automatically been populated with the contact id copilot gave me in the previous question!

Example 2

For my second example I am going to use one very simple topic and a plugin action(preview). My topic is called “Find RSM Offices” which gives information on the address of RSM offices in Florida. I am also going to use my weather plugin action which I created when I wrote a different article. (If you want to learn how to create the plugin action you can read the article here.) For the description in the dynamics chaining trigger of my topic, I entered ‘Find RSM office locations’, and I have one question asking which office the customer is interested in.

The question is a multiple choice type of question, which has the following options to choose from: West Palm Beach, Fort Lauderdale and Coral Gables. Below the question I have a condition for each option, with the name of the location and the address.
Before you test this functionality make sure you enable tracing mode in the test copilot. To start the test, I enter ‘I am looking for an RSM location’. I see the ‘Find RSM Locations’ topic in the Dynamic chain log. I select the Fort Lauderdale office and as expected, I see the message with the address information of the office. Now I enter ‘What is the weather like there?’. At this point Copilot restarts the process of finding the correct topic(s) or plugin action(s) but Copilot doesn’t ask for the city, as I previously picked ‘Fort Lauderdale’. Instead, it immediately provides me with the weather for Fort Lauderdale!

Conclusion

I hope this explains the functionality of dynamic chaining and how you can take advantage of it! This feature will make a BIG difference in building copilots, as it proves you don’t have to create as many custom topics anymore! Keep in mind that this is still a preview feature, which means it might not work perfectly in every scenario. When I was testing the examples above, I tried some other things as well, like asking Copilot ‘I am looking for an RSM office and want to know what the weather is like there’. This resulted in the dynamic chaining of the RSM office topic and the weather plugin, but after I selected an office location, it asked me which location I wanted to get the weather for, which it shouldn’t have.. This is something the Copilot Studio team is aware of, and they are working to fix this! I hope you enjoyed reading this article! Be sure to check in again next week for a new article or subscribe here to never miss another post!



Share this!

Comments are Closed