Adapted from Microsoft Learning
Original Microsoft Learning lab page
Adapted from Lab 2, Exercise 2: Refund Approval HITL Workflow in the MicrosoftLearning/AB-620T00_build_integrated_ai_agents_in_copilot_studio repository, made available by Microsoft Learning under the MIT License.
Copyright (c) 2024 Microsoft. See the repository LICENSE file.
View full MIT License text
MIT License
Copyright (c) 2024 Microsoft
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Changes made by IGOE AI: converted into a UK English follow-along checklist with browser progress tracking, prerequisites and a recap. This is not an official Microsoft page and is not endorsed by Microsoft.
Watch the video
A walkthrough video will appear here once the YouTube ID is added.
What you will build
A published Approve refund request workflow attached to the agent, with Dataverse lookup, a threshold condition, an approvals branch, an auto-approve branch and outputs returned to the agent.
Prerequisites
- Completed Lab 2, Exercise 1 so the Create return authorization workflow and Returns table are in place.
- The Approvals capability is available in your environment.
Scenario
Refund requests above a set threshold need a person to approve them, while smaller requests can be auto-approved. A human-in-the-loop workflow lets the agent start that process without inventing an approval outcome.
Learning outcomes
By the end of this lab, you will be able to:
- Define trigger inputs and look up the related Returns row in Dataverse.
- Branch a workflow on a threshold, with an approvals action above the threshold and auto-approval below it.
- Publish the workflow, attach it to the agent, and test both paths in Preview.
Lab instructions
Section A0: Before You Start (Prerequisites)
Verify baseline environment readiness and solo-testing settings before building the approval workflow.
Section A1: Task 1: Create the Workflow
Create a new agent-callable workflow in Copilot Studio and give it a clear name.
Section A2: Task 2: Define the Trigger Inputs
Configure the three input parameters passed by the agent when invoking the workflow.
Section A3: Task 3: Look Up the Returns Row
Query Dataverse for the matching return authorization record.
Section A4: Task 4: Add the Threshold Condition
Route refunds above $100 to supervisor approval and auto-approve refunds of $100 or less.
Section A5: Task 5: Above-Threshold Branch: Request Approval
Send an approval request for refunds greater than $100 and update the Returns row based on the outcome.
Section A6: Task 6: Below-Threshold Branch: Auto-Approve
Automatically approve refunds of $100 or less and update the Returns row.
Section A7: Task 7: Return Outputs to the Agent
Ensure every execution branch returns structured outcome data back to the agent.
Section A8: Task 8: Publish and Attach to the Agent
Save and publish the workflow, then add it as a tool on Customer Support Rep Assistant.
Section B9: Task 9: Test Above-Threshold & Below-Threshold Paths in Preview
Verify human-in-the-loop approval (> $100) and automatic approval (<= $100) end-to-end.
What you built
You built and tested the Approve refund request workflow, including above-threshold approval and below-threshold auto-approval paths attached to the Customer Support Rep Assistant.
Open the original Microsoft Learning lab page or view the source GitHub repository.
See where your organisation stands
Complete the short AI and automation scorecard. Your answers stay in your browser. Nothing is sent or stored, and there is no email sign-up.