Build conversations using topics in Copilot Studio agents
Customer scenario
Zava Retail Group is a global retail company operating in brick-and-mortar stores and a rapidly expanding e-commerce platform. To accelerate digital transformation, Zava established an AI Center of Excellence (COE) tasked with identifying high-impact, agentic AI opportunities that improve operational efficiency, employee productivity, and strategic decision-making.
Zava operates in a hybrid cloud environment-Azure for productivity and analytics, AWS for certain legacy workloads, and SAP for supply chain and inventory. They rely on Microsoft 365, Teams, SharePoint, Azure DevOps (ADO), and a mix of third-party and custom systems.
However, the COE faces pressure: Google and AWS teams are actively proposing AI solutions, and Zava’s leadership wants to quickly identify a strategic partner with security, governance, extensibility, and enterprise-grade readiness.
Exercise scenario
Zava Retail Group's AI COE needs early agent pilots that feel real, deliver immediate value, and remain safe and maintainable as they scale.
To demonstrate credible business value, Zava’s COE must show agents can execute structured workflows, not just answer questions. Refund and cancellation scenarios are high-frequency, policy-sensitive interactions where a modular topic design reduces errors, improves consistency, and makes future changes safer.
In this exercise, you’ll build the refund-initiator topic as a reusable workflow module. The topic retrieves order details from the sales transaction knowledge source, extracts key entities from the user request in a structured format, and applies eligibility logic for the 30-day return policy and Platinum flexibility. The topic also prepares a controlled handoff by storing only the required fields in a shared context variable for downstream topics.
In this exercise, you will:
- Create an agent
- Manage existing topics
- Create and edit topics using Copilot
- Create and edit nodes
- Configure variable scope
- Test the agent
This exercise should take approximately 60 minutes to complete.
What you will learn
- How topics complement generative AI responses
- When topics are used to enforce structured conversations
- How to create and refine topics using natural language
- How to use variables
High-level lab steps
- Create an agent using Copilot
- Configure agent details and settings
- Review and disable unnecessary topics
- Create a topic using Copilot
- Edit topic content using natural language
- Test topic behavior
Key concept: Topics and generative AI
When generative AI is enabled, the agent may answer questions dynamically without triggering a topic. This is expected behavior.
Topics are used when you need to:
- Collect required information step by step
- Control the order of questions
- Store responses in variables
- Ensure predictable outcomes
Before you start
Open a new browser tab and navigate to https://github.com/MicrosoftLearning/AB-620T00_build_integrated_ai_agents_in_copilot_studio/raw/main/allfiles/zava-sales-transaction/zava_sales_transactions.xlsx to download the Sales Transaction worksheet locally. This document contains details of the sales transactions for Zava Retail Group.
Exercise 1 - Create a Power Platform environment
In this exercise, you will prepare your Power Platform environment and solution to build agents with Copilot Studio.
Task 1.1 - Power Platform Admin Center
Before you start the lab exercises, you must create a development environment for you to work in.
-
Open a web browser, navigate to
https://admin.powerplatform.microsoft.com/manage/environments, and sign in using your credentials for this exercise. -
If prompted, choose the option to stay signed in.
-
Close any pop-up messages that are displayed.
Task 1.2 - Add Dataverse to the default environment
-
Select the ellipses (...) for the Contoso (default) environment and select Add Dataverse.

-
Leave all of the default settings and select Add.
Task 1.3 - Create a new environment
-
In the Environments page, select + New to create a new environment with the following settings:
- Type: Developer
- Region: Default region
- Name: Your name
- Environment group: None
- Make this a Managed Environment: No
- Get new features early: No
- Create on behalf: No

-
Select Next and in the Add Dataverse section:
- Language: English (United States)
- Currency: USD ($)
- Deploy sample apps and data: No
-
Select Save and wait until the state of your environment is Ready (you can use the Refresh button to update the display).

-
In a new browser tab, navigate to
https://copilotstudio.microsoft.com/and sign in if prompted. -
Select Get Started, if prompted leaving the default country/region.
-
Skip any welcome messages.
-
In the upper right corner of the page, switch environments by using the Environment Selector and select the environment you created above from the list.

Task 1.4 - Create a solution
-
In the left navigation pane, select the ellipses (...), and select Solutions.
-
You should see several solutions including the Default Solution and the Common Data Services Default Solution.

-
Select + New solution.
-
In the Display name text box, enter
Lab Exercises -
Verify that Name is automatically populated.
-
Select + New publisher below the Publisher drop-down.
-
For Display name, enter
Zava Retail Group -
For Name, enter
zavaretailgroup -
For Prefix, enter
zava
-
Select Save.
-
Verify that Zava Retail Group (zavaretailgroup) is selected in the Publisher drop-down.
-
Select the Set as your preferred solution checkbox.

-
Select Create.
-
Close the Solutions browser tab.
-
Refresh the Copilot Studio page.
Exercise 2 - Create an agent
In this exercise, you’ll create the Zava Retail Help Desk Agent and configure it for controlled, business-aligned behavior.
Task 2.1 – Create an agent to answer questions on refunds and returns
-
In the Copilot Studio home page
https://copilotstudio.microsoft.com/, verify that you are in the developer environment that you created. -
Select Agents in the left-hand navigation.
-
In the bottom-left of the Start building by describing what your agent needs to do text box, select the Agent Settings icon, which is displayed as a Cog image.

-
Leave English (United States) set as the primary language for the agent.
-
In the Solution drop-down, select Lab Exercises.
-
Enter
zavahelpdeskagentfor the Schema name. -
Select Update.
-
In the Start building by describing what your agent needs to do text box, Enter the following prompt:
You are an agent that assists Zava Retail Group employees with store operations, warehouse insights, company policies, customer experience workflows, and service scenarios, including refund ticket creation, escalation notes, and return/exchange guidance. -
Select the Send icon.
Once your agent has been provisioned, you may proceed with configuring your agent.
Task 2.2 – Configure agent details
-
On the Details tile, select Edit.

-
In the Name field, enter
Zava Retail Operations Assistant. -
In the Description field, enter the following text:
Assists Zava Retail Group employees with store operations, warehouse insights, company policies, customer experience workflows, and service scenarios, including refund ticket creation, escalation notes, and return/exchange guidance.Important: When you need to enter long strings or code segments, use the Copy option instead of Type, and then paste the text into the field in the user interface.
-
On the Details tile, select Save.
-
On the Select your agent's model tile, select GPT-5 Chat. Wait while Copilot Studio processes the request.

-
On the Instructions tile, select Edit.

-
In the Instructions field, enter the following text as this text provides detailed guidance for the agent.
You assist Zava Retail Group employees by providing fast, accurate, and policy‑aligned guidance for store operations and all customer‑resolution workflows. Your tone is professional, concise, accurate, and supportive. **Whenever a request involves refunds, returns, replacements, cancellations, or defective‑item issues, you must follow these steps without exception:** 1. First, call the [refund‑initiator] topic. 2. Use [current date] as current date for you to accurately calculate whether a customer's request falls within the 30‑day return window or exceeds it. 3. Retrieve these fields exactly as stored in the knowledge source: transaction_id, order_date, product_name, unit_price, order_quantity, loyalty_tier, applied_promotions, and subtotal (unit_price × order_quantity). 4. You must independently calculate whether the transaction is within or outside the 30‑day return window using the order_date. 5. Never ask the customer to confirm the order_date or eligibility under any circumstances. 6. Never substitute store location, store name, or any non-date value in place of the order_date. If location data is present in the source, do not include it in the response. 7. If the order_date is missing or not a valid date, treat the lookup as incomplete and respond: "We could not retrieve the order date for this transaction. Please re-enter the order ID." 8. Apply the return policies below: - Non‑Platinum Tier: returns allowed only within 30 days; this limit cannot be extended. - Platinum Tier: VIP flexibility applies at all times, regardless of timing. Your final output must follow these rules: • The response must be one concise paragraph. • It must begin with: "I'm sorry for the inconvenience you've experienced." • Then state: "We located your transaction [transaction_id] made on [order_date]," followed by product_name, unit_price, order_quantity, loyalty_tier (as "Platinum Tier" or "Non‑Platinum Tier"), applied_promotions, and subtotal exactly as stored. • You must explicitly state eligibility using exactly one of the following forms: - "Based on the purchase date, you are eligible for a return because this transaction is within the 30‑day return window." - "Based on the purchase date, you are not eligible for a return because this transaction is outside the 30‑day return window and the policy cannot be extended." - "Although this transaction is outside the 30‑day return window, you are still eligible because Platinum Tier customers receive VIP flexibility." • Do not ask the customer to confirm any retrieved details. • End the paragraph politely. This output format is mandatory. No additional fields, text, or store location information may be added. -
Scroll up to the top of the instructions panel, and locate Step 2 in the text that you just pasted.
-
Highlight and delete [current date], then enter / From the list of suggestions, select Power FX.

-
In the Enter formula popup, enter
Text(Now(),DateTimeFormat.ShortDate), and then select Insert.
-
Scroll to the top of the Instructions section, and then select Save.
Task 2.3 – Configure agent knowledge settings
-
In the upper-right of the page, select the Settings button.

-
Note that Orchestration is set to Yes - Responses will be dynamic, using available tools and knowledge as appropriate.
-
In the Knowledge section, set Allow ungrounded responses to Off.
-
In the Knowledge section, set Use information from the Web to Off.

-
Select Save
-
In the upper-right of the Settings page, select X to close settings.
Task 2.4 – Agent response settings
-
In the upper-right of the page, select the Settings button.
-
In the Responses section, enter the following:
- For process related answer respond with a single sentence. - For order data-related answers respond with bullet points.
-
Select Save
-
In the upper-right of the Settings page, select X to close settings.
Task 2.5 – Upload sales transactions as knowledge
-
Select the Knowledge tab to see the knowledge sources defined in your agent (currently there should be none).

-
Select + Add knowledge, and note the multiple types of knowledge source that you can add to your agent.

-
In the Upload file section, use select to browse to upload the sales transaction worksheet you downloaded previously and select Add to agent.

[!NOTE] After uploading the file, Copilot Studio begins indexing. This may take 10 minutes or longer.
Exercise 3 - Manage topics
In this exercise, you will disable the Escalate system topic as the agent will not have human representatives to hand-off to and check the configuration of the Conversational boosting topic.
Task 3.1 – Disable topic
-
Select the Topics tab.
-
Select the System filter.
-
Locate the Escalate topic.
-
Toggle Enabled to Off for the Escalate topic.

Disabling unused topics helps reduce ambiguity when multiple topics or generative responses could handle the same request.
Task 3.2 – Conversational boosting topic
-
Select the Topics tab.
-
Select the System filter.
-
Select the Conversational boosting topic.
-
Locate the Create generative answers node.

-
At the top right of the node, select the ellipses (…), then select Properties.

-
In the Create generative answers properties pane, locate the Classic data section.
-
Verify that Allow the AI to use its own general knowledge (preview) is disabled.
Exercise 4 - Create a topic with natural language
In this exercise, you'll build the refund-initiator topic as a reusable workflow module. The topic retrieves order details from the sales transaction knowledge source, extracts key entities from the user request in a structured format, and applies eligibility logic for the 30-day return policy and Platinum flexibility. The topic also prepares a controlled handoff by storing only the required fields in a shared context variable for downstream topics.
Task 4.1 – Add a topic from description
-
Select the Topics tab.
-
Select + Add a topic and select Add from description with Copilot. A new dialog appears.


-
In the Name your topic text box, enter
refund-initiator. -
In the Create a topic to... text box, enter
This topic must activate without exception for any customer request involving refunds, returns, replacements, defective or damaged items, or order cancellations.. -
Select Create.
-
Select Save.
Task 4.2 - Update agent instructions
-
Select the Overview tab.
-
In the Instructions section, select Edit.
-
Locate "1. First, call the [refund‑initiator] topic." in the agent description.

-
Highlight and delete [refund-initiator], then enter
/. From the list of suggestions, select refund-initiator.
-
On the Instructions tile, select Save.

Task 4.3 - Add generative answers node
-
On the command bar for the agent, select Topics and then select refund-initiator.
-
If a message node has been added to the topic, at the top right of the node, select the ellipses (…), then select Delete.
-
Below the Trigger node, select Add node (the + sign) and then select Advanced. Select Generative answers.

-
Select the title for the node.
-
In the Title field, enter
Fetch Customer Order Details.
-
In the Input field, select the ellipses (...), select System tab, and then select
Activity.Text.
Note: The Missing required property 'UserInput' message should no longer be visible.
-
At the top right of the node, select the ellipses (...) and then select Properties.
-
In the Create generative answers properties pane, in the Knowledge sources section, set Search only selected sources to On.
-
In the list of knowledge sources, select Zava Sales Transactions.

-
Move down to the Content moderation level section and then select Customize.
-
If necessary, set the level to High.
-
In the text field below the content moderation level field, enter the following text:
Below is the customer's message: Activity.Text Instructions: When responding to a customer request that includes a transaction or order ID, begin with a brief empathy statement such as: "I'm sorry for the inconvenience you've experienced." Then say: "We located your transaction [order_id] made on [order_date]," followed by the product name, unit price, order_quantity, applied promotions, order_date, and the subtotal calculated as [unit_price × order_quantity]. Keep your response as one concise paragraph. Do not make decisions on the customer's behalf. End the paragraph politely, and do not ask the customer to confirm any details you have already retrieved.
-
Move down to the bottom of the pane and then expand Advanced.
-
Ensure that the Send a message checkbox is selected.
-
Set Save LLM response to Text only.
-
In the Save bot response as field, select Select a variable.
-
Select Create new.
-
In the Save bot response as field, select Var1.
-
In the Variable properties pane, in the Variable name field, enter
varGenerateAIResponse. -
At the top right of the Variable properties pane, select X to close the pane.

-
Select the + icon below the Fetch Customer Order Details node and select Send a message.

-
In the text field for the Message node, select Insert variable ({X}), select System tab and then select
Activity.value.
-
On the command bar for the topic, select Save.
-
If the Test pane is not open, on the command bar for the agent, select Test.
-
In the Test pane, select Start new test session (the + sign).

-
Submit the following prompt:
How can I request a refund for order TXN‑2008, which I no longer need? -
Review the response. In addition to providing a response, the agent provides a link to the sources that it used to generate the response.

Task 4.4 – Add an adaptive card node
In addition to adding updating existing nodes, you can use Copilot to add new ones.
-
On the command bar for the agent, select Topics and then select refund-initiator.
-
At the top right of the message node, select the ellipses (…), then select Delete.
-
If the Edit with Copilot pane is not displayed, select the Copilot icon in the topic's command bar.

-
Select an empty area on the authoring canvas so no node is selected.
-
In the Edit with Copilot pane, in the What do you want to do? field, enter the following text:
Ask the user to confirm the refund with an adaptive card. If the adaptive card response is Yes then add a message node confirming refund. If the adaptive card response is no then End all topics -
Select Update.
An Ask with an Adaptive Card node is added to the end of the topic.

-
In the text field for the Message node, select Insert variable ({X}), select Custom tab and then select
varGenerateAIResponse. -
Select the Media box in the Adaptive Card. The Adaptive Card properties should appear on the right of the page.

-
Your Adaptive Card formula should look similar to the one above. If it doesn't, then you can paste in the formula below:
{ type: "AdaptiveCard", body: [ { type: "TextBlock", size: "Medium", weight: "Bolder", text: "Refund Confirmation" }, { type: "TextBlock", text: "Do you want to process a refund for your order?" }, { type: "ActionSet", actions: [ { type: "Action.Submit", title: "Yes", data: { confirmRefund: true } }, { type: "Action.Submit", title: "No", data: { confirmRefund: false } } ] } ] } -
On the command bar for the topic, select Save.
Exercise 5 - Variable scope
Enable variables to be accessed by other topics.
Task 5.1 - Configure the scope of the variables
-
On the command bar for the agent, select Topics and then select refund-initiator.
-
Select Variables in the top bar to open the Variables pane (you may need to select More > Variables).
-
Select and expand Topic variables.

-
Select each of the topic variables in turn.

-
Select Global.
-
select X to close the variable pane.
-
Select Save.
Exercise 6 - Test the agent
In this exercise, you will test topic routing and confirm the conversation follows the expected step-by-step flow.
Task 6.1 - Test the Book Showing topic
-
Select the Test icon in the upper-right of the page to open the Test pane.
-
In the Test pane, select the ellipses (...) next to the variables {x} icon, and toggle Show activity map when testing to On and Track between topics to Off.

-
At the top of the Test pane, select the Start new test session icon +.
-
When the Conversation Start message appears, your agent will start a conversation. In response, enter the following prompt:
Provide a list of transaction ids and products for loyalty id ZAVA-10100 -
The agent should respond with the a list of three orders.

-
In response, enter the following text to trigger the topic:
Start a refund for TXN-2036 -
Confirm
Yesto the adaptive cared.The agent responds with a confirmation message indicating the refund process has been submitted.

Summary
In this lab, you created the Cthe refund-initiator topis and used nodes to enforce a structured, step-by-step interaction while generative AI remained enabled. You also configured variable scope so information collected can be used across topics.