Topics, Tools and Variables
Build agent conversations with topics, integrate tools and flows, manage variable scopes, and format responses with Power Fx.
The Building Blocks of an Agent Conversation
Think of a topic as a recipe card. Each card has a title (the trigger β what makes the agent start this recipe), a list of steps (nodes β questions, messages, conditions), and sticky notes (variables β bits of information the agent remembers while cooking).
Tools are the kitchen appliances β a blender (prebuilt connector), a custom sous-vide machine (custom connector), or a delivery service (HTTP call). The agent picks the right tool for each step.
Variables are the labels on your ingredient jars. Some labels only exist for one recipe (topic variables). Others are visible across the whole kitchen (global variables). And some are printed by the manufacturer and you cannot change them (system variables).
Topics: Triggers, Nodes, and Flow
A topic is a self-contained conversation unit. It has three parts:
Trigger phrases β natural language phrases that activate the topic. When a user says something that matches (or is semantically close to) a trigger phrase, the agent starts that topic. Examples: βtrack my delivery,β βwhere is my package,β βshipment status.β
Nodes β the steps in the conversation canvas:
| Node Type | Purpose |
|---|---|
| Message | Send a message to the user |
| Question | Ask and store the answer in a variable |
| Condition | Branch based on variable values |
| Call an action | Invoke an agent flow or connector |
| Redirect | Jump to another topic |
| Transfer | Hand off to a live human |
| Generative answers | AI generates a response from knowledge |
Variables β data containers that hold information collected during the conversation.
Adding Flows to a Topic
To call an agent flow from a topic, you use the Call an action node. The process:
- Add a Call an action node to the canvas.
- Select the flow β only flows with the βWhen an agent calls a flowβ trigger appear.
- Map input parameters β connect topic variables to flow inputs. Types must match.
- Map output parameters β capture flow return values into topic variables.
- Branch on results β use a Condition node to check
successand handle errors.
The mapping is where most mistakes happen. If a flow expects a number but receives text, the flow fails at runtime β the authoring canvas does not always catch type mismatches at design time.
Tool Types
Tools are how the agent reaches beyond conversation into action. Four types are available in Copilot Studio.
| Feature | Prebuilt Connectors | Custom Connectors | MCP Servers | HTTP Actions |
|---|---|---|---|---|
| What it is | Microsoft-managed connectors for popular services (SharePoint, Outlook, Dataverse, SQL) | OpenAPI-based connectors you build for proprietary or third-party APIs | Model Context Protocol servers that expose tools for AI agents to discover and call | Direct HTTP calls configured in a flow β GET, POST, PUT, DELETE |
| Setup effort | Minimal β select and authenticate | Medium β import OpenAPI spec, configure auth | Medium β deploy MCP server, register with agent | Low β configure URL, headers, body in the flow |
| Auth model | Connection references managed by Power Platform | OAuth2, API key, or certificate configured in the connector | Depends on MCP server implementation | Manual β you set headers and tokens in the HTTP action |
| Best for | Microsoft 365 and common SaaS integrations | Internal APIs or niche SaaS products without prebuilt connectors | AI-native integrations where the agent dynamically discovers available tools | One-off API calls where building a connector is overkill |
| Exam signal | Default choice for Microsoft ecosystem | Question mentions proprietary API or OpenAPI | Question mentions dynamic tool discovery or AI orchestration | Question mentions quick integration or no connector available |
Variable Scopes
Variables in Copilot Studio have four scopes. Getting the scope wrong is one of the most common mistakes β and a frequent exam topic.
| Scope | Visibility | Lifetime | Set By | Example |
|---|---|---|---|---|
| Topic | Only within the current topic | Exists while the topic is active; cleared when the topic ends | Question nodes, Set Variable action, flow outputs | Topic.CustomerName, Topic.OrderID |
| Global | Across all topics in the agent | Persists for the entire conversation session | Set Variable action with global scope, flow outputs | Global.UserLanguage, Global.IsAuthenticated |
| System | Read-only, across all topics | Set by the platform at runtime | Copilot Studio runtime | System.User.DisplayName, System.Conversation.Id, System.Activity.Text |
Exam tip: Use global variables for cross-topic state
If you need a variable that survives across topic redirects β like whether the user is authenticated, their preferred language, or a cart total that accumulates across multiple product topics β it must be a global variable. Topic variables are destroyed when the topic ends.
A common exam trap: a scenario where variable data is lost after a topic redirect. The answer is always βchange from topic scope to global scope.β
Response Formatting
Copilot Studio supports rich response formatting using markdown and Power Fx expressions:
Markdown in messages β bold, italic, bullet lists, numbered lists, and links work in message nodes. The rendering depends on the channel (Teams renders full markdown; a custom web chat may not).
Power Fx for dynamic content β you can use Power Fx expressions inside message nodes to format data dynamically:
// Concatenate strings
"Hello, " & Topic.CustomerName & "! Your order " & Topic.OrderID & " is " & Topic.Status & "."
// Format a number as currency
"Total: $" & Text(Topic.Amount, "0.00")
// Conditional text
If(Topic.DaysUntilDelivery <= 1, "arriving tomorrow!", "arriving in " & Text(Topic.DaysUntilDelivery) & " days.")
// Format a date
"Shipped on " & Text(Topic.ShipDate, "dd MMM yyyy")
Power Fx in Copilot Studio uses Power Apps syntax but only a subset of functions is available.
π Dev Adds Tools to the Delivery Tracker
Dev is enhancing his logistics agentβs delivery tracking topic. Currently the topic only shows a static status message. He wants to add real-time tracking data from three sources.
Step 1: Prebuilt connector for Dataverse β Dev adds a Call an action node that invokes a flow using the Dataverse connector. The flow takes Topic.TrackingNumber as input, queries the Shipments table, and returns the current status, estimated delivery date, and driver name.
Step 2: Custom connector for the carrier API β The carrier exposes a REST API. Devβs team built a custom connector from the OpenAPI spec. He adds another flow call to get the real-time GPS location.
Step 3: HTTP action for weather β Dev wants to warn customers about weather delays. He adds a flow with an HTTP GET action that calls a public weather API using the delivery city from the Dataverse result. No connector needed β it is a simple one-off call.
Step 4: Response formatting β Dev composes a rich response combining all three data sources using Power Fx concatenation with Char(10) line breaks, Text() for date formatting, and If() for a conditional weather alert. Each data source used a different tool type (prebuilt, custom, HTTP).
Key Terms
Knowledge Check
Dev's delivery tracking topic collects a tracking number, calls a Dataverse flow, and then redirects to an upsell topic. The upsell topic needs the customer name collected in the tracking topic. What should Dev do?
Priya at AgentForge is building an ISV agent that needs to call a customer's proprietary inventory API. The API has an OpenAPI spec and uses OAuth2 authentication. Which tool type should she use?
An agent topic calls a flow that expects a Number input, but the developer mapped a Text variable containing '42'. What happens?
π¬ Video coming soon
Topics, Tools and Variables
Next up: Advanced Responses: Custom Prompts and Generative Answers β control how your agent generates responses using custom prompts, knowledge sources, and the generative answers node.