0% found this document useful (0 votes)
4 views44 pages

Section 4 Class Notes

This document provides an in-depth exploration of the Action Framework in Copilot Studio, detailing how it transforms conversational bots into autonomous agents capable of executing tasks through AI Plugins, Power Automate, and Connector-based actions. It covers core concepts, practical case studies, and step-by-step examples for integrating Power Automate and REST APIs, emphasizing the importance of input/output mapping and authentication. The document also includes multiple-choice questions to reinforce understanding of the material presented.

Uploaded by

gimit.sachin
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views44 pages

Section 4 Class Notes

This document provides an in-depth exploration of the Action Framework in Copilot Studio, detailing how it transforms conversational bots into autonomous agents capable of executing tasks through AI Plugins, Power Automate, and Connector-based actions. It covers core concepts, practical case studies, and step-by-step examples for integrating Power Automate and REST APIs, emphasizing the importance of input/output mapping and authentication. The document also includes multiple-choice questions to reinforce understanding of the material presented.

Uploaded by

gimit.sachin
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Chapter: Understanding the Action

Framework in Copilot Studio


1. Chapter Title & Objective
Chapter Name: Understanding the Action Framework in Copilot Studio

Objective: In this chapter, you will explore the mechanisms that transform a conversational bot
into an autonomous agent. You will master the Action Framework, learning how the agent
orchestrates "doing" tasks—such as fetching data, updating records, and triggering workflows—
using AI Plugins, Power Automate, and Connector-based actions.

2. Core Concepts & Theory


In Copilot Studio, "Actions" are the hands and feet of your agent. While the Large Language
Model (LLM) provides the "brain" for conversation, the Action Framework provides the
interface to the physical and digital world.

A. What is an Action?

An Action is a discrete task that the agent can execute. Unlike a standard "Topic" which manages
conversation, an "Action" manages an integration. When an agent encounters a user request that
requires external data (e.g., "What is my order status?"), the Action Framework determines
which tool is best suited for the job.

B. The Three Pillars of the Framework

1. Power Automate Flows: The most common action type. It allows you to build complex,
multi-step logic across 1,000+ apps.
2. AI Plugins (Dynamic Chaining): This is the modern "Agentic" approach. Instead of
manually linking a topic to a flow, you define the plugin's capabilities, and the agent
dynamically decides to call it when relevant.
3. Connector Actions: Direct calls to APIs (like Salesforce, SAP, or SQL) without needing
an intermediate flow, optimized for speed and low latency.

C. Input and Output Mapping

For any action to work, the framework relies on variables:

[Link]
 Inputs: Data the agent sends to the action (e.g., CustomerEmail).
 Outputs: Data the action sends back to the agent (e.g., TotalInvoices).

D. Authentication and Security

Actions operate under security constraints. You must plan for Connection References, ensuring
the action has the correct credentials (OAuth, API Key, or Service Account) to access the target
system.

3. Practical Case Study: "The Automated IT Provisioning


Agent"
Organization: CloudScale Tech

The Challenge: The IT department spends 40 hours a week manually resetting passwords and
granting access to SharePoint folders.

The Solution: The team implemented the Action Framework within their internal Copilot:

1. The Action: A Power Automate flow was created to interface with Microsoft Graph API.
2. Triggering: When a user says "I can't access the Marketing folder," the agent identifies
the intent.
3. Execution: The agent captures the user's ID (System Variable) and passes it to the
Action. The Action checks the user's permissions and, if eligible, grants access
automatically.
4. Feedback: The Action returns a "Success" status to the agent, which then informs the
user: "You now have access to the Marketing folder. Happy collaborating!"

The Result: 80% of routine access requests are now handled by the agent, allowing IT staff to
focus on high-priority security architecture.

4. Step-by-Step Example: Creating a Direct Connector


Action
This example demonstrates how to add a simple "Weather" action to your agent using a pre-built
connector.

Phase 1: Adding the Action

[Link]
1. Open your agent and navigate to the Actions (or Plugins) tab on the left.
2. Click + Add an action.
3. Search for the MSN Weather connector.
4. Select the action Get current weather.

Phase 2: Mapping Inputs

1. The framework will identify that this action requires a Location (Input).
2. Map this to a variable: [Link].
3. Set the Display to users option to "Hidden" if you want the agent to handle it silently in
the background.

Phase 3: Utilizing the Output

1. In your "Weather Topic," add a node: Call an action and select the MSN Weather action
you just configured.
2. The action will return several outputs (Temperature, Conditions, etc.).
3. Add a Message Node to display the result: "The current temperature in {[Link]}
is {[Link]} degrees."

Technical Concept (JSON Payload)

Behind the scenes, the Action Framework generates a JSON request to the connector:

JSON
{
"action": "Get_Current_Weather",
"parameters": {
"location": "Delhi",
"units": "Metric"
},
"connection": "msnweather_connection_id"
}

5. Multiple-Choice Questions (MCQs)


Q1. What is the primary advantage of using "AI Plugins (Dynamic Chaining)" over
manually calling a Power Automate flow in a topic?

A) AI Plugins are free, while flows cost money.

B) The agent can intelligently decide when to use a plugin based on its description, even if the
developer didn't explicitly link it to a specific topic.

[Link]
C) AI Plugins only work with Python.

D) AI Plugins do not require authentication.

Answer: B

Explanation: Dynamic chaining allows for "Agentic" behavior. By providing a clear description
of what a plugin does (e.g., "Use this to check stock levels"), the agent can utilize the plugin
whenever a user's intent matches that description, offering more flexibility than a hard-coded
topic path.

Q2. In the Action Framework, what must be configured to ensure an agent can securely
access a private SQL database?

A) A public website link.

B) A Connection Reference with valid credentials.

C) A Fallback Topic.

D) A 3D model of the database.

Answer: B

Explanation: Actions require permissions. A Connection Reference stores the "how-to-connect"


information (credentials/API keys) securely, allowing the agent to perform tasks on behalf of the
user or a service account.

Q3. If an action returns a "List" of items (e.g., five recent orders), which node should the
developer use to process these items in the Studio?

A) Condition Node.

B) Message Node.

C) For Each (Loop) Node.

D) Trigger Phrase Node.

Answer: C

Explanation: When an Action provides an array or list of data, the "For Each" node allows the
agent to iterate through each item, enabling it to display multiple records or perform a calculation
on each piece of data returned.

[Link]
Chapter: Connecting to Power Automate for
Business Logic
1. Chapter Title & Objective
Chapter Name: Connecting to Power Automate for Business Logic

Objective: In this chapter, you will master the integration between Microsoft Copilot Studio and
Power Automate. You will learn how to design cloud flows that serve as the "logical engine" for
your agent, enabling it to perform complex calculations, manipulate data, and connect to
hundreds of external applications beyond the native capabilities of the Copilot interface.

2. Core Concepts & Theory


While Copilot Studio excels at conversation, Power Automate is the industry standard for
workflow automation. Connecting the two allows you to move from "simple chat" to "business
process automation."

A. The "Flow" Architecture

When an agent calls Power Automate, it follows a specific request-response pattern. Every flow
used by an agent must contain two specific triggers/actions:

1. Run a flow from Copilot: This is the trigger that receives data (Inputs) from the agent.
2. Respond to Copilot: This is the terminal action that sends data (Outputs) back to the
agent.

B. Input and Output Variables

Data is passed between the two platforms through variables.

[Link]
 Inputs: You define these in the Power Automate trigger. Common types include Text,
Number, and Boolean.
 Outputs: These are defined in the response action. They allow the agent to use the results
of the flow in subsequent conversation nodes.

C. Solution Context

For an agent to "see" a Power Automate flow, the flow must be created within the same Power
Platform environment and, ideally, within a Solution. This is a critical requirement for ALM
(Application Lifecycle Management) and ensures that your agent and its logic can be moved
between Dev, Test, and Production environments together.

D. Connectors and Logic

Inside the flow, you can leverage over 1,000+ pre-built connectors (e.g., Excel, SQL, Salesforce,
Outlook) or use Expression Language (WDL) to perform complex logic that would be difficult
to build inside the Copilot Studio authoring canvas.

3. Practical Case Study: "The Instant Insurance Quote"


Organization: SafeHarbor Insurance

The Challenge: SafeHarbor wants to provide instant premium quotes to customers. Calculating
a quote involves a complex mathematical formula based on age, location, and coverage type,
which is stored in a legacy Excel table.

The Solution:

1. Copilot Studio: The agent collects the user's Age, PostCode, and CoverageType.
2. Power Automate: The agent calls a flow named "CalculateInsuranceQuote."
o The flow takes the three inputs.
o It uses the Excel Online (Business) connector to find the base rate.
o It applies a mathematical expression to calculate the final premium.
o It returns the FinalQuote as a currency string.
3. Result: The agent presents the final figure to the user: "Based on your details, your
monthly premium will be $45.00."

The Impact: SafeHarbor saw a 300% increase in quote requests because users could get answers
in seconds without waiting for a callback from a broker.

[Link]
4. Step-by-Step Example: Creating a Calculation Flow
This example demonstrates how to build a flow that adds two numbers and returns the result—a
fundamental exercise for understanding the data handshake.

Phase 1: Create the Flow in Power Automate

1. In Copilot Studio, click + Add a node in any topic and select Call an action > Create a
flow.
2. In the new window, select the Run a flow from Copilot trigger.
3. Click Add an input > Number. Name it FirstValue. Add a second number input
named SecondValue.
4. Add a new step: Compose. In the input field, use an expression:
add(triggerBody()['number'], triggerBody()['number_1']) .
5. Add the final step: Respond to Copilot.
6. Click Add an output > Number. Name it ResultSum. Map it to the output of your
Compose step.
7. Save the flow as "Math_Addition_Flow".

Phase 2: Call the Flow from Copilot Studio

1. Back in your topic, select Call an action and pick "Math_Addition_Flow".


2. Map Inputs: For FirstValue, select your Topic.Number1 variable. Map SecondValue
to Topic.Number2.
3. Use Output: Add a Message Node after the action: "The sum of your numbers is
{[Link]}."

Technical Representation (JSON Mapping)

JSON
{
"inputs": {
"FirstValue": 10,
"SecondValue": 25
},
"outputs": {
"ResultSum": 35
}
}

5. Multiple-Choice Questions (MCQs)

[Link]
Q1. Which two actions are MANDATORY for a Power Automate flow to be compatible
with Microsoft Copilot Studio?

A) Initialize Variable and Set Variable.

B) HTTP Request and HTTP Response.

C) Run a flow from Copilot (Trigger) and Respond to Copilot (Action).

D) Get Record (Dataverse) and Update Record (Dataverse).

Answer: C

Explanation: For the "Handshake" to occur, the flow must start with the specific Copilot trigger
to receive data and end with the Respond action to pass data back to the conversation.

Q2. You have created a Power Automate flow to fetch data, but it does not appear in the
'Call an action' list in Copilot Studio. What is the most likely reason?

A) The flow is turned off.

B) The flow was created in a different Power Platform environment than the agent.

C) The flow contains more than 10 steps.

D) The flow uses a Premium connector.

Answer: B

Explanation: Copilot Studio agents are environment-bound. They can only "see" and trigger
flows that exist within the same environment.

Q3. What is the primary benefit of performing a calculation in Power Automate rather
than using a Variable Set node in Copilot Studio?

A) Power Automate is faster for simple addition.

B) Power Automate offers an extensive Expression Language (WDL) and connectors to external
data sources that Copilot Studio cannot access directly.

C) Power Automate does not require a license.

D) Power Automate automatically translates the result into the user's language.

[Link]
Answer: B

Explanation: While Copilot Studio can do basic variable manipulation, Power Automate is
designed for heavy lifting—complex math, data transformation, and cross-application logic.

Chapter: Deep Dive: Using REST APIs as


Agent Tools
1. Chapter Title & Objective
Chapter Name: Deep Dive: Using REST APIs as Agent Tools

Objective: In this chapter, you will master the technical integration of external web services into
your AI agents. You will learn the architecture of RESTful communication, how to configure
HTTP requests as agent tools, and how to parse JSON responses to enable your agent to interact
with virtually any modern software system that exposes an API.

2. Core Concepts & Theory


While pre-built connectors cover many common scenarios, professional agent developers often
need to connect to proprietary or niche systems. This is where REST (Representational State
Transfer) APIs become the ultimate tool in your arsenal.

A. The Anatomy of an API Tool Call

When an agent uses a REST API as a tool, it acts as a client sending a structured request over the
web. To configure this, you must understand four key components:

[Link]
 Endpoint (URL): The specific web address where the service lives (e.g.,
[[Link]/v1/data]([Link] ).
 Methods (Verbs):
o GET: Retrieve data.
o POST: Create or send data.
o PATCH/PUT: Update existing data.
o DELETE: Remove data.
 Headers: Metadata for the request, often used for Authentication (e.g.,
Authorization: Bearer <token> ) or defining content types.
 Body: The payload of the request, usually formatted in JSON.

B. Authentication Methods

To pass the AB-620 exam, you must understand how to secure these tools:

 API Keys: A simple string passed in the header or query parameter.


 OAuth 2.0: The enterprise standard for secure, delegated access.
 No Auth: Used only for public, non-sensitive data (e.g., public weather or stock feeds).

C. JSON Parsing and Data Binding

APIs return data in JSON (JavaScript Object Notation). Copilot Studio must "parse" this raw text
into Variables that the agent can speak or use in logic.

 Example: If an API returns {"status": "shipped"}, the agent maps this to a variable
like [Link].

3. Practical Case Study: "The Real-Time Inventory


Specialist"
Organization: Global Parts Distribution

The Challenge: The sales team uses a custom-built legacy ERP system that has no official
Microsoft connector. Sales reps lose hours calling the warehouse to check if a specific part is in
stock before committing to a sale.

The Solution: The organization exposes a REST API endpoint for their inventory. The agent
developer builds a custom tool in Copilot Studio:

[Link]
1. The Tool: An HTTP GET request configured to
[[Link]/api/inventory/]([Link]
ventory/){PartID}.
2. The Interaction: A sales rep asks the agent, "Do we have any 'XJ-900' gaskets in the
Delhi warehouse?"
3. The Execution: The agent extracts "XJ-900" as an entity, performs the REST call via the
tool framework, and receives a JSON response.
4. The Result: The agent parses the JSON and replies: "Yes, we have 45 units of XJ-900
available in Delhi. Would you like to reserve them?"

The Impact: Part-availability inquiries were reduced from 15 minutes (phone call) to 5 seconds
(agent interaction), drastically increasing sales velocity.

4. Step-by-Step Example: Calling a Public REST API


This example demonstrates how to configure an HTTP tool call to a public "Random Quote" API
to understand the request/response flow.

Phase 1: Identifying the API

 Endpoint:
[[Link]
 Method: GET
 Response Format: {"content": "Quote text", "author": "Author Name"}

Phase 2: Configuration in Copilot Studio (via Power Automate)

1. In your topic, add a node: Call an action > Create a flow.


2. Add the HTTP action to the flow.
3. Set Method to GET and URI to
[[Link] .
4. Add a Parse JSON action.
o Content: The body from the HTTP action.
o Schema: Use the "Generate from sample" button and paste: {"content":
"text", "author": "name"}.
5. In the Respond to Copilot action, add two Text outputs: QuoteText and AuthorName.

Phase 3: Displaying the Tool Output

1. Back in Copilot Studio, map the flow outputs to topic variables.

[Link]
2. Add a Message Node: "Here is your quote: '{[Link]}' —
{[Link]}."

Technical Concept (JSON Structure)

JSON
{
"request": {
"url": "[Link]
"method": "GET"
},
"response": {
"content": "Intelligence is the ability to adapt to change.",
"author": "Stephen Hawking"
}
}

5. Multiple-Choice Questions (MCQs)


Q1. Which HTTP method is the most appropriate for an agent tool designed to update a
customer's phone number in an external CRM?

A) GET

B) POST

C) PATCH

D) DELETE

Answer: C

Explanation: While POST can be used to create data, PATCH (or PUT) is the specific RESTful
method intended for updating existing resources. GET is only for retrieving data, and DELETE
is for removal.

Q2. When an agent tool receives a raw JSON response from a REST API, what must the
developer do so the agent can use specific pieces of that data in a conversation?

A) Convert the JSON into an image.

B) Use a "Parse JSON" action to map the data fields to variables.

C) Ask the user to read the JSON code.

[Link]
D) Hard-code the response in the Trigger Phrase.

Answer: B

Explanation: Parsing JSON is the process of breaking down the structured text string into usable
data objects. This allows the developer to extract specific values (like a "Price" or "Status") and
assign them to variables the agent can reference.

Q3. What is the primary purpose of an "Authorization" header in a REST API tool call?

A) To tell the API which language the agent speaks.

B) To define the color of the chat interface.

C) To provide credentials (like a Bearer Token) that prove the agent has permission to access the
data.

D) To speed up the internet connection.

Answer: C

Explanation: Most enterprise APIs are secured. The Authorization header is the standard
location for passing security tokens or keys to ensure only authorized agents can retrieve or
modify sensitive business data.

Chapter: Building and Deploying Custom


Connectors
1. Chapter Title & Objective
Chapter Name: Building and Deploying Custom Connectors

Objective: In this chapter, you will learn how to bridge the gap between Microsoft Copilot
Studio and proprietary or niche web services. You will master the end-to-end process of creating
Custom Connectors, from defining the OpenAPI specification to configuring security protocols
and deploying the connector for use within your AI agent’s action framework.

[Link]
2. Core Concepts & Theory
While the Microsoft Power Platform offers over 1,000 pre-built connectors, enterprise
environments often rely on in-house APIs. A Custom Connector acts as a "wrapper" around a
REST API that allows Copilot Studio to communicate with it as if it were a native service.

A. The Three Building Blocks

To build a custom connector, you need three primary components:

1. The API Endpoint: A publicly accessible URL (or one accessible via an On-premises
Data Gateway).
2. API Definition: A description of the API’s functions. This is usually provided as an
OpenAPI (Swagger) file or a Postman Collection.
3. Security Definition: The method used to prove the agent’s identity to the API.

B. The Connector Lifecycle

The deployment follows a structured path:

 Definition: Describing the host, base URL, and paths.


 Authentication: Configuring OAuth 2.0, API Key, or Basic Auth.
 Actions: Defining the operations (e.g., GetEmployeeRecord) and mapping their
inputs/outputs.
 Testing: Validating the connection within the Power Platform maker portal before
publishing.

C. On-Premises Data Gateway

If the API you are connecting to lives behind a corporate firewall (and not on the public web),
you must utilize an On-premises Data Gateway. The gateway acts as a secure bridge, allowing
the cloud-based Copilot to reach into the local network without compromising security.

3. Practical Case Study: "The Legacy HR Portal"


Organization: Heritage Manufacturing

The Challenge: Heritage uses a 15-year-old proprietary HR system for managing employee
leave balances. The system has a REST API, but no official Microsoft connector exists.
Employees currently have to log into a clunky web portal just to check their remaining vacation
days.

[Link]
The Solution: The technical team decided to build a Custom Connector:

1. Definition: They exported the Swagger file from the HR system’s API.
2. Authentication: They configured API Key authentication, as required by the legacy
system.
3. Implementation: In Copilot Studio, they added an "Action" using this new connector
called CheckLeaveBalance.
4. Result: Employees now ask the agent in Microsoft Teams, "How many days of leave do
I have?" The agent calls the custom connector, retrieves the value, and displays it
instantly.

The Impact: Portal login traffic decreased by 90%, and employee satisfaction improved due to
the "zero-friction" access to personal data.

4. Step-by-Step Example: Creating a Custom Connector


This example walks through the manual creation of a connector for a mock "Order Tracking"
API.

Phase 1: General Information

1. Log into the Power Apps Maker Portal.


2. Navigate to Custom Connectors under the "More" or "Data" menu.
3. Select New custom connector > Create from blank.
4. Host: Enter [Link].
5. Base URL: Enter /v1/.

Phase 2: Defining the Action

1. Go to the Definition tab and click New Action.


2. Summary: GetOrderStatus.
3. Operation ID: GetStatus.
4. Click Import from sample under the Request section:
o Verb: GET
o URL:
[[Link]
[Link]/v1/status?id=){orderid}
5. Click Import. The system will automatically create the orderid parameter.

Phase 3: Deployment and Testing

[Link]
1. Click Create Connector at the top.
2. Navigate to the Test tab.
3. Create a New Connection by providing your API Key.
4. Enter a sample orderid and click Test operation. Ensure you receive a 200 OK response
with the expected JSON payload.

5. Multiple-Choice Questions (MCQs)


Q1. You are building a Custom Connector for an API that exists inside your company’s
private local network. Which component is required to allow Copilot Studio to access this
API?

A) A Public Website Knowledge Source.

B) An On-premises Data Gateway.

C) A System Fallback Topic.

D) A Python Script.

Answer: B

Explanation: An On-premises Data Gateway is the mandatory bridge for cloud services (like
Copilot Studio) to securely communicate with data sources or APIs located within a private, non-
publicly accessible network.

Q2. Which file format is the industry standard used to import API definitions into a new
Custom Connector?

A) .MP3

B) .PDF

C) OpenAPI (Swagger)

D) .DOCX

Answer: C

[Link]
Explanation: OpenAPI (formerly known as Swagger) is the standard machine-readable
architectural language used to describe REST APIs. Using this file allows the connector to
automatically map all available endpoints and parameters.

Q3. After creating a Custom Connector, what is the next step to make it functional within a
Copilot Studio topic?

A) You must wait 24 hours for it to sync.

B) You must add it as an "Action" or "Plugin" within the Copilot Studio environment.

C) You must change the bot's name to match the connector.

D) You must delete all other pre-built connectors.

Answer: B

Explanation: Simply creating the connector in the Power Platform is not enough. You must
explicitly add it to your specific agent as an Action. This allows the agent to recognize the
connector’s capabilities and use it to satisfy user intents.

[Link]
Chapter: Integrating ServiceNow for Real-
time Ticket Status
1. Chapter Title & Objective
Chapter Name: Integrating ServiceNow for Real-time Ticket Status

Objective: In this chapter, you will learn how to connect Microsoft Copilot Studio to
ServiceNow, a leading enterprise Service Management (ITSM) platform. You will master the
process of utilizing pre-built connectors and Power Automate to enable your agent to retrieve,
summarize, and display live support ticket data, providing users with immediate transparency
into their service requests.

2. Core Concepts & Theory


Integrating ServiceNow into an AI agent moves the needle from simple "informational" AI to
"operational" AI. For the AB-620 exam, you must understand the architecture of this integration.

A. The ServiceNow Connector

Microsoft provides a first-party ServiceNow Connector for Power Automate. This connector
allows the agent to interact with various ServiceNow tables, such as:

 Incident (incident): For IT support issues.


 Request (sc_request): For service or hardware orders.
 Change (change_request): For infrastructure updates.

B. Dynamic Filtering and OData

To provide "Real-time Status," the agent shouldn't just fetch every ticket. It must use OData
system query options to filter results.

 Filter Logic: You can filter by the user's email address (u_caller_id) or ticket number
(number).
 Status Mapping: ServiceNow uses integer values for states (e.g., 1 = New, 2 = In
Progress, 6 = Resolved). Your agent must "translate" these codes into human-friendly
text.

[Link]
C. Security and Impersonation

When an agent queries ServiceNow, it typically uses one of two methods:

1. Service Account: The agent uses a dedicated "Bot User" in ServiceNow with read-only
access to all incidents.
2. User Impersonation/Delegated Access: The agent uses the credentials of the logged-in
user to ensure they only see their own tickets.

3. Practical Case Study: "The Zero-Wait Helpdesk"


Organization: MetroHealth Systems

The Challenge: MetroHealth's IT helpdesk receives 400 calls daily from employees asking,
"What is the status of my ticket?" These calls consume 30% of the helpdesk agents' time,
preventing them from actually fixing the issues.

The Solution: MetroHealth deployed an AI Agent in Microsoft Teams integrated with


ServiceNow.

1. The Intent: A topic was created for "Check Ticket Status."


2. The Logic: The agent identifies the user via their Teams login, calls a Power Automate
flow, and queries the ServiceNow incident table for all active tickets where the user is
the "Caller."
3. The Interaction:
o User: "Status of my laptop issue?"
o Agent: "I found incident INC004521. Its current status is 'In Progress,' and it was
last updated 2 hours ago by Agent Sarah."

The Result: Helpdesk call volume for "Status Checks" dropped by 85% in the first month, and
employee satisfaction increased due to instant 24/7 access to information.

4. Step-by-Step Example: Building a ServiceNow Status


Flow
This example demonstrates how to create the Power Automate "logic engine" to fetch a specific
ticket status.

[Link]
Phase 1: Configure the ServiceNow Connector

1. In Power Automate, create a new flow triggered by Run a flow from Copilot.
2. Add a Text Input called TicketNumber.
3. Add the action ServiceNow: List Records.
o Table: Incident (incident)
o Display Value: true (This helps return names instead of sys_ids).
o Filter Query: number={TicketNumber}

Phase 2: Parse and Format

1. Add a Compose action to extract the "State" from the first record in the list.
o Expression: first(outputs('List_Records')?['body/value'])?['state']
2. Add a Respond to Copilot action.
3. Create an output called CurrentStatus and map it to your Compose result.

Phase 3: Copilot Studio Implementation

1. Create a topic with trigger phrases like "Where is my ticket?"


2. Use a Question Node to ask: "What is your Incident Number (e.g., INC001234)?"
3. Save the response as [Link].
4. Add a node: Call an action and select your ServiceNow flow.
5. Map TicketNumber to [Link].
6. Add a Message Node: "I've checked the system! The status of {[Link]} is currently
{[Link]}."

5. Multiple-Choice Questions (MCQs)


Q1. A developer is using the ServiceNow 'List Records' action in Power Automate. Which
parameter should be used to ensure the agent only retrieves tickets created by the currently
logged-in user?

A) Sort By

B) Filter Query (e.g., caller_id.email='user@[Link]')

C) Limit

D) Table Name

Answer: B

[Link]
Explanation: The Filter Query allows you to use OData syntax to limit the results. Without a
filter, the action might return thousands of records, which is inefficient and potentially a security
risk.

Q2. ServiceNow represents ticket states as integers (e.g., '1', '2', '3'). What is the best way
to ensure the AI Agent tells the user 'In Progress' instead of 'State 2'?

A) Change the ServiceNow database settings.

B) Use a Condition or Switch node in the agent or flow to translate the integer to a text string.

C) Ask the user to memorize the ServiceNow codebook.

D) Set the variable type to 'Boolean'.

Answer: B

Explanation: Translation of technical codes into "Warm Storytelling" language is a core duty of
the agent developer. A Switch node in Power Automate or a Condition node in Copilot Studio is
the standard way to map 2 to In Progress.

Q3. When connecting to ServiceNow via Power Automate, what is the purpose of an 'On-
premises Data Gateway'?

A) It is required if your ServiceNow instance is hosted on a private local server rather than the
ServiceNow cloud.

B) It makes the agent's responses faster in Microsoft Teams.

C) It is used to generate 3D images of the tickets.

D) It is required for all ServiceNow connections.

Answer: A

Explanation: Most ServiceNow instances are SaaS (Cloud), but if a company uses an on-
premises installation behind a firewall, the Data Gateway is necessary to bridge the cloud-based
Power Automate to the local server.

[Link]
Chapter: Using SAP Connectors for Supply
Chain Visibility
1. Chapter Title & Objective
Chapter Name: Using SAP Connectors for Supply Chain Visibility Objective: In this chapter,
you will learn how to integrate Microsoft Copilot Studio with SAP ERP systems. You will
master the architectural requirements for connecting to SAP, understand how to utilize the SAP
ERP connector in Power Automate to retrieve real-time supply chain data, and learn how to
present complex logistics information (such as Purchase Order status and Inventory levels)
through a conversational interface.

2. Core Concepts & Theory


Integrating SAP into an AI agent provides "Single Pane of Glass" visibility into complex supply
chain operations. Because SAP is a robust, highly secure enterprise resource planning (ERP)
system, the connection framework requires specific attention to middleware and authentication.

A. The SAP ERP Connector

Microsoft provides a specialized SAP ERP Connector that allows Power Automate to
communicate with SAP systems via OData (Open Data Protocol) or BAPI (Business
Application Programming Interface) calls.

 OData: Ideal for modern SAP S/4HANA environments, allowing for RESTful web
service interactions.
 BAPI/RFC: Used for traditional SAP ECC systems to trigger internal business functions.

[Link]
B. The On-Premises Data Gateway

Since most SAP production environments are hosted within a private corporate network (on-
premises or private cloud), a Data Gateway is mandatory. This gateway acts as a secure,
outbound-only proxy that allows your agent to query SAP without opening a firewall port to the
public internet.

C. Authentication and Single Sign-On (SSO)

Supply chain data is highly sensitive. For the AB-620 exam, you must understand:

 Basic Authentication: Using a service account with specific SAP roles.


 Kerberos-based SSO: Allowing the agent to impersonate the user, ensuring the user
only sees the supply chain data they are authorized to view (e.g., a regional manager only
seeing their region's inventory).

D. Key Supply Chain Use Cases

 Inventory Inquiry: Checking "Stock on Hand" for specific Material IDs.


 Order Tracking: Retrieving the shipping status of a Purchase Order (PO).
 Supplier Validation: Checking the "Preferred" status of a vendor before a requisition is
made.

3. Practical Case Study: "The Global Logistics Bottleneck"


Organization: Titan Industrial Parts The Challenge: Titan manages over 200,000 SKUs in
SAP. Field technicians frequently call the central warehouse to check if critical repair parts are in
stock. This creates a bottleneck, as warehouse staff spend 4 hours a day manually looking up
parts in SAP GUI.

The Solution: Titan implemented a "Supply Chain Agent" in Copilot Studio:

1. Connectivity: They installed an On-Premises Data Gateway and configured the SAP
ERP connector.
2. The Flow: A Power Automate flow was designed to accept a Material_ID and call the
SAP BAPI BAPI_MATERIAL_GET_DETAIL.
3. The Interaction: A technician in the field asks the agent: "Do we have SK-998 gaskets
in the Mumbai warehouse?"
4. The Action: The agent triggers the flow, queries SAP in real-time, and retrieves the
"Quantity on Hand."

[Link]
The Result: "Time-to-Information" dropped from 20 minutes to 15 seconds. Warehouse staff
were freed from routine lookups, and repair downtime decreased by 12% globally.

4. Step-by-Step Example: Querying SAP Inventory


This example demonstrates how to build the Power Automate logic that connects your agent to
an SAP OData service.

Phase 1: Configure the SAP Trigger

1. In Power Automate, create a flow with the Run a flow from Copilot trigger.
2. Add a Text Input called MaterialID.

Phase 2: Call SAP ERP

1. Add the action SAP ERP: Call SAP function (V3) or Call OData function.
2. Connection: Select your configured Gateway connection.
3. Function Name: Select BAPI_MATERIAL_AVAILABILITY.
4. Inputs: Map the MaterialID from the trigger to the MATERIAL field in the BAPI
parameters. Specify the PLANT (e.g., 1000).

Phase 3: Parse and Return

1. Add a Compose action to extract the AV_QTY (Available Quantity) from the SAP
response.
2. Add a Respond to Copilot action.
3. Create an output called StockLevel and map it to your Compose result.

Phase 4: Copilot Studio Deployment

1. Create a topic "Check Inventory" with trigger phrases like "Is this part in stock?"
2. Add a Question Node for the Part Number.
3. Call the action created above and display: "According to SAP, we currently have
{[Link]} units available in the warehouse."

5. Multiple-Choice Questions (MCQs)

[Link]
Q1. An organization wants to connect Copilot Studio to an on-premises SAP ECC system.
Which component is strictly required to bridge the cloud-to-on-premise gap? A) A Public
Website Knowledge Source. B) An On-Premises Data Gateway. C) A Python script running on a
local PC. D) An SAP Mobile App.

Answer: B Explanation: The On-Premises Data Gateway is the foundational component


required to securely connect Microsoft Cloud services (like Copilot Studio and Power Automate)
to data sources residing behind a corporate firewall, such as an on-premises SAP instance.

Q2. When a user asks an AI Agent for the status of a Purchase Order (PO) in SAP, what is
the primary benefit of using Single Sign-On (SSO) for the connection? A) It makes the
agent's responses 50% faster. B) it ensures the agent respects SAP’s internal security roles, so
users only see POs they are authorized to access. C) It allows the agent to work without an
internet connection. D) It converts the SAP data into a 3D model.

Answer: B Explanation: SSO/Delegated Authentication ensures security and compliance. By


passing the user's identity through to SAP, the system applies the same row-level security and
permissions that the user would have in the SAP GUI.

Q3. Which protocol is typically used when connecting Copilot Studio to a modern SAP
S/4HANA environment via a web-friendly RESTful interface? A) FTP B) SMTP C) OData
D) COBOL

Answer: C Explanation: OData (Open Data Protocol) is the standard for modern SAP
integrations. It allows SAP data to be exposed as RESTful APIs, which are easily consumed by
the connectors in the Microsoft Power Platform.

[Link]
Chapter: Creating Human-in-the-Loop
(HITL) Workflows
1. Chapter Title & Objective
Chapter Name: Creating Human-in-the-Loop (HITL) Workflows

Objective: In this chapter, you will master the design and implementation of Human-in-the-
Loop (HITL) systems. You will learn how to balance AI autonomy with human oversight,
specifically focusing on how to trigger manual approvals, handle complex escalations, and
ensure high-stakes AI actions are verified by a person before execution.

2. Core Concepts & Theory


In the world of Agentic AI, "autonomy" does not mean "unsupervised." For enterprise-grade
agents, certain actions—such as processing a large refund, deleting data, or sending an external
legal document—require a human "gatekeeper." This is the essence of Human-in-the-Loop
(HITL).

A. The HITL Trigger Points

An agent should not call for a human every time it gets stuck; that defeats the purpose of
automation. Instead, HITL should be designed into the workflow based on:

[Link]
 Confidence Thresholds: If the AI is only 60% sure of a solution, it pauses and asks for
verification.
 Business Rules: Any transaction over a specific dollar amount (e.g., $500) automatically
requires a human signature.
 High-Impact Outcomes: Actions that are irreversible or carry legal liability.

B. The Handoff Architecture

There are two primary ways to implement HITL in the AB-620 ecosystem:

1. Synchronous Handoff (Live Chat): Using the "Transfer to Agent" node to move a user
to a live person in Dynamics 365 Omnichannel for Customer Service.
2. Asynchronous Handoff (Approvals): Using Power Automate Approvals. The agent
pauses the conversation, sends a request to a manager (via Teams or Email), and waits for
a "Yes/No" before proceeding.

C. Contextual Continuity

The most critical technical requirement for HITL is the Transcript Transfer. When a human
joins the loop, they must receive the full context (variables, previous messages, and user intent)
so the user doesn't have to repeat themselves.

3. Practical Case Study: "The High-Value Refund Policy"


Organization: LuxuryStays Hospitality

The Challenge: LuxuryStays uses an AI agent to handle booking cancellations. While the AI
can easily handle standard $50 cancellation fees, the company has a policy that any refund
exceeding $1,000 must be reviewed by a Floor Manager to prevent fraud.

The Solution:

1. Logic Gate: The developer added a condition node in Copilot Studio: If


[Link] > 1000.
2. The HITL Action: If true, the agent triggers a Power Automate flow that creates a
Teams Approval for the Management team.
3. The Interaction: The agent tells the user, "I have calculated a refund of $1,200. Because
this exceeds the standard limit, I have sent a request to my manager for approval. I will
notify you here once they have reviewed it."
4. The Completion: Once the manager clicks "Approve" in Teams, the flow signals the
agent to send the final confirmation message and process the payment via the Stripe API.

[Link]
The Result: The company maintained 24/7 automation for 90% of requests while ensuring
100% human oversight on high-risk financial transactions.

4. Step-by-Step Example: Building an Approval Loop


This example demonstrates how to pause an agent's logic until a human provides an approval via
Power Automate.

Phase 1: Create the Approval Flow

1. In Power Automate, create a flow with the Run a flow from Copilot trigger.
2. Add a Text Input called RequestDetails.
3. Add the action Approvals: Start and wait for an approval.
o Approval Type: "Approve/Reject - First to respond."
o Title: "AI Agent: Approval Required."
o Assigned To: [Your Email].
o Details: RequestDetails.
4. Add a Condition node: If Outcome is equal to Approve.
5. In both branches, add the Respond to Copilot action.
o Output (Text): ManagerDecision. Map this to the Outcome of the approval.

Phase 2: Integrate into Copilot Studio

1. In your "Refund" topic, add the node Call an action and select the Approval flow.
2. Map RequestDetails to a summary of the user's request.
3. Add a Condition Node after the flow:
o If [Link] is "Approve": Send message "Your request was
approved and is being processed."
o If [Link] is "Reject": Send message "I'm sorry, the manager
has declined this request. Would you like to speak to them directly?"

Technical Concept (The Waiting State)

During an asynchronous HITL loop, the agent enters a "Waiting" state. The conversation ID is
preserved in the Power Platform environment, allowing the flow to "call back" to the specific
user session once the human acts.

5. Multiple-Choice Questions (MCQs)

[Link]
Q1. Which node should be used if you want to move a user from the AI Agent to a live
human representative in real-time within Dynamics 365?

A) Redirect Node

B) Condition Node

C) Transfer to Agent Node

D) Variable Set Node

Answer: C

Explanation: The "Transfer to Agent" node is the standard mechanism for synchronous HITL. it
sends the conversation transcript and context to an integrated engagement hub like Omnichannel
for Customer Service.

Q2. In an asynchronous HITL workflow using Power Automate Approvals, what happens
to the AI Agent while the human is reviewing the request?

A) The agent continues to ask the user random questions.

B) The agent crashes and the user must start over.

C) The agent session remains active or in a "waiting" state, depending on the channel, until the
flow receives the human's response.

D) The agent automatically approves the request after 5 minutes.

Answer: C

Explanation: HITL workflows are designed to "pause" logic execution. The flow "Waits for an
approval," and only once that human input is received does it send the response back to the agent
to trigger the next conversational node.

Q3. Why is "Confidence Threshold" a common trigger for HITL workflows?

A) It makes the agent's voice sound more human.

B) It ensures that if the AI is uncertain about the correct answer, it defers to a human rather than
providing potentially incorrect or harmful information.

C) It allows the agent to work without an internet connection.

[Link]
D) It reduces the cost of the LLM tokens.

Answer: B

Explanation: Using confidence scores as a trigger for human intervention is a key safety and
accuracy strategy. It prevents "hallucinations" by recognizing when the AI's retrieval or
generation is weak and calling for human oversight.

Chapter: Handling API Authentication:


OAuth2 and API Keys
1. Chapter Title & Objective
Chapter Name: Handling API Authentication: OAuth2 and API Keys

Objective: In this chapter, you will master the security protocols required to connect AI agents
to protected data sources. You will learn the technical differences between API Keys and
OAuth 2.0, how to configure security headers in Copilot Studio, and the best practices for
managing credentials to ensure your agent remains compliant with enterprise security standards.

2. Core Concepts & Theory

[Link]
Security is the "gatekeeper" of the Action Framework. When an agent attempts to retrieve data
from a private system, it must present a digital credential. Without proper authentication, your
agent is limited to public data, significantly reducing its business utility.

A. API Keys (The Simple Token)

An API Key is a unique string used to identify a calling program. It is the most straightforward
form of authentication.

 Mechanism: The key is typically passed in the HTTP Header (e.g., x-api-key:
your_key_here) or as a Query Parameter in the URL.
 Best Use Case: Low-to-medium security internal services or third-party data providers
(like weather or currency converters).
 Risk: If the key is exposed, anyone can use it. It does not identify the individual user,
only the application.

B. OAuth 2.0 (The Enterprise Standard)

OAuth 2.0 is a delegated authorization framework. It allows the agent to access data on behalf of
a user without ever seeing the user's password.

 The Flow: The user logs into a trusted provider (like Microsoft Entra ID or Google). The
provider gives the agent an Access Token.
 Scopes: OAuth allows for "granular permissions." You can grant the agent "Read" access
to mail but not "Delete" access.
 Best Use Case: Accessing personal user data in Microsoft 365, Salesforce, or SAP.

C. Authentication in the Action Framework

In Copilot Studio, authentication is handled at two levels:

1. Bot-Level Authentication: Determines who the user is (e.g., "Only for Teams").
2. Action-Level Authentication: Determines how the agent talks to a specific API.

3. Practical Case Study: "The Secure CRM Connector"


Organization: FinTech Solutions India

The Challenge: FinTech Solutions uses a custom CRM to store sensitive client investment
portfolios. They want an agent to provide balance updates to employees. Using a single API Key

[Link]
for the whole company was a security violation, as it didn't track which employee was looking at
which client's data.

The Solution: The team implemented OAuth 2.0 with Delegated Permissions:

1. Configuration: They registered the agent as an application in Microsoft Entra ID.


2. The Handshake: When an employee asks, "What is the balance for Client A?", the agent
triggers an OAuth flow.
3. The Validation: The CRM receives the user's specific token. It verifies that the
employee has the "Account Manager" role before releasing the data.
4. The Result: The agent provides the balance securely. If a junior staff member without
permissions asks the same question, the API returns a 403 Forbidden error, and the
agent politely explains they lack access.

The Impact: The company passed its security audit while successfully automating 1,200 internal
data queries per month.

4. Step-by-Step Example: Configuring an API Key in Power


Automate
Most AB-620 implementations use Power Automate as the bridge for authenticated calls. Here is
how to set up an API Key for a custom tool.

Phase 1: Security Setup in Flow

1. Create a flow with the Run a flow from Copilot trigger.


2. Add the HTTP action.
3. Enter the API Method (e.g., GET) and URI.
4. Click Show advanced options to reveal the Headers section.
5. Key: Authorization

Value: Bearer YOUR_API_KEY_HERE (Note: Many APIs require the word "Bearer"
before the key).

Phase 2: Protecting the Key

1. To prevent the key from appearing in plain text in logs, click the three dots (...) on the
HTTP action.
2. Select Settings.
3. Enable Secure Inputs and Secure Outputs.

[Link]
Phase 3: Copilot Studio Integration

1. Call this flow from your topic.


2. Ensure you handle the 401 Unauthorized status code. If the API returns 401, add a
Condition Node in the agent to tell the user: "I'm having trouble accessing the system.
Please contact IT."

5. Multiple-Choice Questions (MCQs)


Q1. Which authentication method is best suited for an agent that needs to access a specific
user's private emails in Outlook?

A) API Key

B) No Authentication

C) OAuth 2.0

D) Basic Authentication (Username/Password)

Answer: C

Explanation: OAuth 2.0 is designed for delegated access. It allows the agent to act on behalf of
the specific authenticated user, ensuring it only accesses the emails that the specific user has the
rights to see.

Q2. When configuring an HTTP action for an API that uses an API Key, where is the most
common and secure place to insert the key?

A) In the Trigger Phrase of the topic.

B) In the HTTP Header (e.g., x-api-key).

C) In the bot's display name.

D) In a public comment on the Power Automate community forum.

Answer: B

Explanation: Passing keys in headers is more secure than passing them in the URL (query
parameters), as URL parameters are often logged in plain text by web servers.

[Link]
Q3. What is the purpose of enabling "Secure Inputs" and "Secure Outputs" in a Power
Automate flow used by an agent?

A) It makes the flow run faster.

B) It masks sensitive data (like API Keys or PII) so it does not appear in the flow's run history
logs.

C) It translates the data into 3D models.

D) It allows the flow to work without an internet connection.

Answer: B

Explanation: For enterprise compliance (GDPR/SOC2), it is critical that secrets and sensitive
data are not stored in log files. Enabling these settings ensures that the information is hidden
from anyone viewing the execution history.

Chapter: Error Handling and Retries in


Integration Flows
1. Chapter Title & Objective
Chapter Name: Error Handling and Retries in Integration Flows

[Link]
Objective: In this chapter, you will learn how to build resilient AI agents that can gracefully
handle technical failures. You will master the implementation of Error Handling patterns in
Power Automate, configure Retry Policies for API calls, and learn how to communicate
"System Downtime" to users without breaking the conversational experience.

2. Core Concepts & Theory


In a perfect world, APIs always respond and flows always succeed. In the enterprise world,
networks fluctuate, services go down, and "Timeouts" occur. A professional agent must be
designed to fail safely.

A. The "Try-Catch-Finally" Pattern

This is the industry-standard logic for error handling, implemented in Power Automate using
Scopes.

 Try: The scope containing the main actions (e.g., calling an SAP API).
 Catch: This scope only runs if the "Try" scope fails. It captures the error details.
 Finally: This scope runs regardless of success or failure, often used to close connections
or send a final status back to the agent.

B. Retry Policies

When a transient error occurs (like a 429 "Too Many Requests" or a 503 "Service Unavailable"),
a "Retry" is often the solution.

 Default Policy: Most connectors retry 4 times using an exponential backoff.


 Custom Policy: You can define specific intervals (e.g., wait 10 seconds and try again) to
handle specific service-level agreements (SLAs).

C. Timeouts and Latency

Copilot Studio has a maximum wait time for an action response (typically 120 seconds). If your
integration flow takes longer, the agent will trigger a "System Error." You must optimize your
flows to return a "Waiting" status or use asynchronous patterns for long-running tasks.

D. User-Facing Error Messages

Technical error codes (e.g., Error 0x80040216) should never be shown to the user. Instead, use
a Condition Node to catch a "Failure" output from your flow and provide a helpful, non-

[Link]
technical response: "I'm having a bit of trouble reaching the warehouse database right now.
Please try again in a few minutes."

3. Practical Case Study: "The Resilient Payroll Agent"


Organization: Global Staffing Solutions

The Challenge: The company’s payroll API is notoriously unstable during the last two days of
the month due to high traffic. The AI agent would "crash" frequently when employees asked for
their payslips, leading to high frustration.

The Solution:

1. Redundancy: The developer wrapped the Payroll API call in a Try-Catch block.
2. The Catch Logic: If the API fails after the maximum retries, the "Catch" block triggers a
Power Automate action that logs a "Manual Support Ticket" and sets a variable
FlowStatus to "Degraded."
3. Conversational Handling: The agent checks FlowStatus. If "Degraded," it tells the
employee: "The payroll system is currently very busy. I've logged your request, and an
email with your payslip will be sent to you automatically as soon as the system clears."

The Result: Support tickets regarding "Broken Bot" dropped by 90%. Users felt informed rather
than ignored during system outages.

4. Step-by-Step Example: Implementing a Retry Policy and


Scope
This example shows how to configure a flow to handle a failing HTTP request to a weather
service.

Phase 1: Set Up the Scopes

1. In Power Automate, create a flow with the Run a flow from Copilot trigger.
2. Add a Scope and rename it to Try_Scope. Inside, add your HTTP action.
3. Add a second Scope below it and rename it to Catch_Scope.
4. Configure Run After: Click the three dots (...) on Catch_Scope > Configure run after.
Uncheck "is successful" and check "has failed" and "has timed out".

[Link]
Phase 2: Configure Retry Policy

1. On the HTTP action inside the Try_Scope, click the three dots (...) > Settings.
2. Under Retry Policy, select Fixed Interval.
3. Set Count to 3 and Interval to PT10S (10 seconds).

Phase 3: Communicate back to Copilot

1. In the Catch_Scope, add a Respond to Copilot action.


2. Add a Text output: StatusMessage = "Service is currently unavailable."
3. In the Try_Scope (at the end), add a Respond to Copilot action.
4. Add a Text output: StatusMessage = "Success".

5. Multiple-Choice Questions (MCQs)


Q1. In Power Automate, which feature allows you to specify that a certain group of actions
should only execute if the previous actions have failed or timed out?

A) Parallel Branch

B) Configure Run After

C) Trigger Conditions

D) Data Operations

Answer: B

Explanation: "Configure Run After" is the mechanism used to create Try-Catch logic. It allows
a developer to define the dependency of an action or scope based on the outcome (Success,
Failure, Timeout, or Skipped) of the preceding step.

Q2. Your agent's integration flow is calling a legacy API that occasionally takes 3 minutes
to respond. What will likely happen in Copilot Studio?

A) The agent will wait indefinitely for the response.

B) The agent will time out and present a "System Error" to the user.

C) The agent will automatically speed up the API.

[Link]
&D) The agent will guess the answer.

Answer: B

Explanation: AI agents have specific timeout limits for external actions. If a flow exceeds this
limit (usually 2 minutes), the connection is severed, and the agent triggers the System Error
logic.

Q3. Why should a developer enable "Secure Inputs" and "Secure Outputs" when logging
an error in a Catch block?

A) To make the error message colorful.

B) To ensure that sensitive data (like passwords or PII) that may have caused the failure is not
visible in the flow's run history.

C) To bypass the need for a license.

D) To prevent the bot from being deleted.

Answer: B

Explanation: Error logs often capture the "Body" of the failed request. If that request contained
sensitive information, failing to secure the logs would result in a data privacy violation. Enabling
these settings masks the data in the logs.

[Link]
Chapter: Passing Input and Output
Parameters Between Systems
1. Chapter Title & Objective
Chapter Name: Passing Input and Output Parameters Between Systems

Objective: In this chapter, you will master the "Data Handshake"—the critical technical process
of moving information between Microsoft Copilot Studio and external systems. You will learn
how to define input schemas for actions, map variables from conversation topics to external
workflows, and process output parameters to drive dynamic agent behavior.

2. Core Concepts & Theory


For an AI agent to be truly functional, it must act as a data relay. Parameters are the containers
used to transport this data across the boundaries of different software environments.

A. The Input Schema (The "Request")

Input parameters are the pieces of information an agent sends to a tool (like a Power Automate
flow or a REST API).

 Variable Mapping: You must map a "Topic Variable" (collected from the user) to an
"Action Input."
 Data Types: Precision is vital. Passing a "String" (text) when the external system expects
an "Integer" (number) will result in a runtime error.
 Required vs. Optional: Defining which parameters are mandatory ensures the agent
doesn't trigger a tool with missing data.

B. The Output Schema (The "Response")

Output parameters are the data points sent back from the external system to the agent.

 Parsing: The agent receives a payload (often JSON) and must extract specific values to
store in "Output Variables."
 Usage: These variables are then used to branch logic (Conditions) or to provide a specific
answer to the user via a Message Node.

C. The Mapping Interface

[Link]
In Copilot Studio, the "Call an Action" node serves as the visual mapper.

1. Inputs Section: Displays the names of variables expected by the flow/API.


2. Value Picker: Allows you to select the corresponding variable from your agent's current
conversation.
3. Outputs Section: Lists the variables that will be created in the agent's memory once the
action completes.

3. Practical Case Study: "The Dynamic Discount Validator"


Organization: Apex Retail Group

The Challenge: Apex offers personalized discounts based on a customer's "Loyalty Tier" and
"Cart Value." The calculation logic lives in a legacy SQL database, not in the bot.

The Parameter Flow:

1. Inputs: The agent collects the Customer_Email and the Current_Cart_Total.


2. The Handshake: These two parameters are passed to a Power Automate flow.
3. External Logic: The flow queries SQL using the email to find the "Tier" and applies a
math formula to the cart total.
4. Outputs: The flow returns two parameters: Discount_Amount (Number) and
Coupon_Code (String).

The Result: The agent tells the user: "Because you are a Gold member, I've applied a $25.00
discount using code GOLD25." By passing parameters correctly, the agent provided a
personalized financial transaction without actually knowing the underlying business rules.

4. Step-by-Step Example: Mapping Parameters for a


Currency Converter
This example demonstrates how to pass a "Source Amount" and "Target Currency" to a tool and
receive the "Converted Rate."

Phase 1: Define the Tool (Power Automate)

1. Create a flow with the Run a flow from Copilot trigger.


2. Add two inputs:

[Link]
o InputAmount (Number)
o TargetCurrency (Text)
3. Add a Respond to Copilot action at the end.
4. Add one output:
o FinalAmount (Number)

Phase 2: Configuration in Copilot Studio

1. In your topic, use a Question Node to ask the user: "How much would you like to
convert?" Save as [Link].
2. Use another Question Node: "Which currency (USD, EUR, GBP)?" Save as
[Link].
3. Add a node: Call an action and select your flow.

Phase 3: The Mapping

1. In the Action Node:


o Map InputAmount $\leftarrow$ [Link]
o Map TargetCurrency $\leftarrow$ [Link]
2. Process the Result:
o The node automatically creates an output variable: [Link].
3. Add a Message Node: "Your converted total is {[Link]}."

5. Multiple-Choice Questions (MCQs)


Q1. When calling an action that requires a 'Number' input, what happens if you map a
'String' variable containing the word 'Ten' to that parameter?

A) The agent will automatically convert the word to the number 10.

B) The action call will fail because of a data type mismatch.

C) The agent will ignore the error and proceed with a value of 0.

D) The agent will ask the user to type the number again.

Answer: B

Explanation: Systems require strict data typing for parameters. A "String" and a "Number" are
stored differently in memory; if the external system (like a Power Automate flow) expects a
numeric value for calculation, providing text will cause the integration to crash or error out.

[Link]
Q2. In the context of parameters, what is 'Output Mapping' in Copilot Studio?

A) Sending the bot's name to the user.

B) Assigning the values returned by an external tool to variables that the agent can use in the
conversation.

C) Printing the conversation history to a PDF.

D) Deleting the variables after the bot is closed.

Answer: B

Explanation: Output mapping is the process of taking the "results" of an action (like a status
code, a price, or a name) and saving them into variables so the agent can reference them later in
the chat.

Q3. A developer wants to send the user's email address to a CRM. The CRM API requires
the parameter name to be User_Email_Address. In Copilot Studio, the variable is named
[Link]. How is this resolved?

A) The developer must rename the variable in Copilot Studio to match the API exactly.

B) The developer uses the 'Call an Action' node to map [Link] to the input field labeled
User_Email_Address.

C) The agent will automatically figure it out using AI.

D) Parameter names do not matter in Copilot Studio.

Answer: B

Explanation: The "Call an Action" node acts as a translation layer. It doesn't matter if the names
match; as long as the developer manually maps the agent's variable to the correct input slot
defined by the tool, the data will flow correctly.

[Link]
[Link]
[Link]

You might also like