Section 4 Class Notes
Section 4 Class Notes
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.
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.
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.
[Link]
Inputs: Data the agent sends to the action (e.g., CustomerEmail).
Outputs: Data the action sends back to the agent (e.g., TotalInvoices).
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.
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.
[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.
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.
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."
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"
}
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.
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?
C) A Fallback Topic.
Answer: B
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.
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.
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.
[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.
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.
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.
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".
JSON
{
"inputs": {
"FirstValue": 10,
"SecondValue": 25
},
"outputs": {
"ResultSum": 35
}
}
[Link]
Q1. Which two actions are MANDATORY for a Power Automate flow to be compatible
with Microsoft Copilot Studio?
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?
B) The flow was created in a different Power Platform environment than the agent.
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?
B) Power Automate offers an extensive Expression Language (WDL) and connectors to external
data sources that Copilot Studio cannot access directly.
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.
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.
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:
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].
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.
Endpoint:
[[Link]
Method: GET
Response Format: {"content": "Quote text", "author": "Author Name"}
[Link]
2. Add a Message Node: "Here is your quote: '{[Link]}' —
{[Link]}."
JSON
{
"request": {
"url": "[Link]
"method": "GET"
},
"response": {
"content": "Intelligence is the ability to adapt to change.",
"author": "Stephen Hawking"
}
}
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?
[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?
C) To provide credentials (like a Bearer Token) that prove the agent has permission to access the
data.
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.
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.
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.
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.
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.
[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.
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?
B) You must add it as an "Action" or "Plugin" within the Copilot Studio environment.
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.
Microsoft provides a first-party ServiceNow Connector for Power Automate. This connector
allows the agent to interact with various ServiceNow tables, such as:
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
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.
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 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.
[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}
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.
A) Sort By
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'?
B) Use a Condition or Switch node in the agent or flow to translate the integer to a text string.
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.
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.
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.
Supply chain data is highly sensitive. For the AB-620 exam, you must understand:
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.
1. In Power Automate, create a flow with the Run a flow from Copilot trigger.
2. Add a Text Input called MaterialID.
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).
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.
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."
[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.
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.
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.
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.
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.
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:
[Link]
The Result: The company maintained 24/7 automation for 90% of requests while ensuring
100% human oversight on high-risk financial transactions.
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.
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?"
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.
[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
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?
C) The agent session remains active or in a "waiting" state, depending on the channel, until the
flow receives the human's response.
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.
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.
[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.
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.
[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.
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.
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.
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.
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:
The Impact: The company passed its security audit while successfully automating 1,200 internal
data queries per month.
Value: Bearer YOUR_API_KEY_HERE (Note: Many APIs require the word "Bearer"
before 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
A) API Key
B) No Authentication
C) OAuth 2.0
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?
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?
B) It masks sensitive data (like API Keys or PII) so it does not appear in the flow's run history
logs.
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.
[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.
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.
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.
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."
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.
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).
A) Parallel Branch
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?
B) The agent will time out and present a "System Error" to the user.
[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?
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.
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.
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.
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.
[Link]
In Copilot Studio, the "Call an Action" node serves as the visual mapper.
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 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.
[Link]
o InputAmount (Number)
o TargetCurrency (Text)
3. Add a Respond to Copilot action at the end.
4. Add one output:
o FinalAmount (Number)
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.
A) The agent will automatically convert the word to the number 10.
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?
B) Assigning the values returned by an external tool to variables that the agent can use in the
conversation.
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.
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]