Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Use variables as input and output parameters to pass information between agent flows and Copilot Studio agents.
Important
An agent can only receive up to 1 MB of data from a flow in a single action. However, there's no limit on how many variables or the amount of data an agent can send.
In this example, you create a flow with an input parameter and return it to an agent as an output parameter.
Prerequisites
- Understand how to create a flow from the Copilot Studio authoring canvas
Supported parameter types
Copilot Studio agents support the following types of input and output parameters for agent flows:
- Number
- String
- Boolean
The following data types aren't supported:
- Object
- Date
- Timestamp
- List [String]
- List [Number]
- List [Boolean]
- List [Object]
- List [Date]
- List [Timestamp]
Create a topic and a flow
Go to the Topics page for your agent.
Create a new topic called Echo message.
Add the trigger phrase echo.
Add a Question node and enter the message "Tell me something and I'll say it back to you."
For Identify, choose User's entire response.
For Save user response as, rename the variable to userResponse.
Select the Add node icon
under the Question node, and select Add a tool.
On the Basic actions tab, select New Agent flow. The agent flow designer tab opens with a starting template for an agent flow called by an agent. The flow includes two actions: When an agent calls the flow and Respond to the agent.
Select Save draft.
On the Overview tab of the flow, edit the details for the flow, replacing the name with Echo parameter. Select Save.
Return to the Designer tab.
Add an input parameter to the flow
Select the When an agent calls the flow flow trigger, and select Add an input.
Select Text and enter the name String_Input.
Add an output parameter to the flow
Select the Respond to the agent response action, and select Add an output.
Select Text and enter the name String_Output.
For the value, enter a slash (
/
) in the box, select Insert dynamic content, and then select the String_Input variable.Select Save draft and Publish. Copilot Studio informs you when the agent flow is published.
Select Go back to agent to return to the agent topic editor. The new action flow is added to the topic.
Call the flow from the topic
Select the new action node.
Set the flow input parameter to the output variable from the Question node: String_Input (string) gets its value from the userResponse variable.
Add a Message node.
Select Insert variable, and then select String_Output.
Select Save.
Test your agent.