6.1 Add Agent Flows to a Topic
Key Takeaways
- Agent flows used with agents require the When an agent calls the flow trigger and a Respond to the agent action with asynchronous response turned off.
- You can add a published agent flow as an agent-level tool for generative orchestration, or call it explicitly as an action node inside a topic for deterministic sequencing.
- Bind topic variables and conversation context to flow inputs; map Respond to the agent outputs into topic variables for later message nodes or branching.
- Classic orchestration only runs a flow when a topic explicitly calls it; generative orchestration can also select a well-described flow tool from agent-level tools based on user intent.
- Flows must respond within the action time limit (typically about 100 seconds before Respond to the agent); long work continues after the response when needed.
6.1 Add Agent Flows to a Topic
Quick Answer: Build an agent flow with When an agent calls the flow and Respond to the agent (async off). Publish it, then either register it as an agent tool for generative orchestration or insert it as an action node inside a topic. Bind inputs from variables or AI slot-filling, capture outputs, then continue the topic with messages, conditions, or further nodes.
AB-620 treats topics as the conversation control surface and agent flows as the multi-step automation engine. Domain 1 leaf skill Add agent flows to a topic expects you to wire those two surfaces together correctly—not merely create a flow that never returns data to the agent.
Why topics need agent flows
A topic alone can ask questions, set variables, send messages, and call many tools. An agent flow shines when you need:
- Multi-step connector choreography (read Dataverse, create ServiceNow incident, email confirmation)
- Human-in-the-loop approvals or long-running steps designed after the agent response
- Consistent, deterministic automation that should not depend on free-form generative planning for every micro-step
- Secrets or shared connections managed with flow run-only settings rather than ad-hoc topic HTTP calls
Microsoft positions agent flows as native Copilot Studio automations (Power Automate–like designer, optimized for agents). You run them as standalone automations or attach them so an agent can invoke them.
Flow prerequisites the exam loves
Before a topic can call a flow as a tool, the flow must meet published requirements:
| Requirement | What to configure | Why it matters |
|---|---|---|
| Trigger | When an agent calls the flow | Only this trigger contracts with the agent runtime |
| Response action | Respond to the agent | Returns outputs the topic or orchestrator can use |
| Async | Asynchronous response = Off on the response action (Networking) | Agent turns expect a synchronous result path |
| Time budget | Respond within the action limit (~100 seconds) | Keep heavy work after Respond when needed (flow can continue up to long run limits) |
| Publish state | Flow is published | Unpublished drafts are not callable |
| Inputs / outputs | Parameters on trigger and Respond action | Binding surface for topic variables |
When you create a new agent flow from the Flows page or as a new tool on the agent, Copilot Studio scaffolds the required trigger and response action. Converting an older cloud flow means swapping in that trigger and response pattern.
Supported input types and hygiene
Runtime guidance commonly expects clean base types—text, boolean, numbers—and non-null values for required inputs. Complex nested objects often need flattening into text or numbers the agent can pass. Null required inputs are a top cause of silent failures at the action node.
Two placement models: agent tool vs topic action
Microsoft documents two mechanisms that both matter on AB-620:
1) Add the flow as an agent-level tool
Path (conceptual):
- Open the agent → Tools → Add a tool → Flow.
- Select a published flow → Add and configure.
- Set Name and a clear Description for the orchestrator.
- Configure each Input fill mode (dynamic AI fill vs custom value).
- Configure Completion (how results return into the conversation).
- Save, then test in the agent test panel.
With generative orchestration (default for new agents), the planner can choose this flow tool based on name, description, inputs/outputs, and conversation context—without a hard-coded topic path—when Allow agent to decide dynamically when to use the tool is enabled.
2) Call the flow explicitly from inside a topic
Path (conceptual):
- Open Topics → edit or create the topic (trigger phrases or generative description as appropriate).
- Add node → Add a tool / call a tool, then select the flow (or create new flow from the node menu where available).
- Map each flow input to a variable, literal, or Power Fx formula.
- On success, map output parameters into topic or conversation variables.
- Continue with Message, Condition, Question, adaptive card, or redirect nodes that consume those outputs.
- Save the topic and republish the agent after meaningful changes.
Classic orchestration agents only call tools (including flows) when a topic node invokes them. Generative orchestration can still benefit from explicit topic calls when you need a fixed sequence—collect card inputs, validate, call flow, then format a compliance-approved message.
| Placement | Best when | Orchestration note |
|---|---|---|
| Agent-level flow tool | Intent-driven single capability (“create expense report,” “look up order”) | Generative planner may select it; descriptions are critical |
| Topic action node | Multi-step UX: card → confirm → flow → formatted result | Deterministic order; works in classic mode |
| Both | Same flow registered at agent level and called from a guided topic | Avoid duplicate ambiguous descriptions that cause double invocation |
Input and output binding patterns
Binding is where exam scenarios hide traps.
Filling flow inputs
- From topic variables: User answered a Question node or submitted an Ask with Adaptive Card; map those variables into trigger inputs.
- From conversation context / generative slot filling: At agent-tool level, default Dynamically fill with AI lets the orchestrator extract values or generate clarifying questions—similar to generative topic input filling.
- Override with custom value: Set a fixed literal, an existing variable, or Power Fx when the value must not be guessed (for example environment-specific IDs from environment variables, or a known case number already captured).
Returning outputs to the topic
The Respond to the agent action defines output parameters. After the action node runs:
- Capture each output into a topic variable.
- Use those variables in a Message node (including formatting and adaptive content).
- Branch with Condition nodes (for example status = Failed → escalation topic).
- Pass outputs into another tool or a redirected topic’s input parameters.
Tip aligned with generative design: for agents using generative orchestration, you can return structured outputs from a topic and let the agent summarize them instead of always hard-coding the final user-facing sentence—while still using flows for the deterministic system writes.
Classic vs generative orchestration implications
| Behavior | Generative orchestration | Classic orchestration |
|---|---|---|
| How a flow is chosen | Planner may select agent-level flow tools from descriptions | Flow runs only when a matching topic’s action node calls it |
| Missing inputs | Orchestrator can auto-generate questions for tool/topic inputs | You author Question nodes (or cards) before the action |
| User response after flow | May auto-summarize tool results unless completion is customized | You author Message nodes after the action |
| Multi-intent queries | May chain topic + flow tool + knowledge | Usually one topic match; design redirects yourself |
| Capacity note | Running a flow via generative orchestration consumes an autonomous-style action plus flow actions | Running a flow from a topic consumes a classic answer plus flow actions |
Exam trap: Enabling generative orchestration does not remove the need for explicit topic calls when compliance requires a fixed order (identity check → adaptive card → flow → confirmation card). Generative flexibility and deterministic topics coexist; choose by risk, not fashion.
End-to-end scenario (device request)
Contoso IT builds Request device:
- Topic trigger description: “Helps employees request a replacement laptop or phone and creates a tracked ticket.”
- Ask with Adaptive Card collects device type, justification, and cost center into variables.
- Condition validates cost center format; on failure, message + re-ask.
- Action node calls agent flow CreateDeviceRequest with inputs
DeviceType,Justification,CostCenter,UserEmail(from system user context where available). - Flow writes Dataverse row, creates ServiceNow request, returns
TicketNumberandStatus. - Message node: “Your request {TicketNumber} is {Status}. IT will follow up within one business day.”
- Optional quick replies: “Check request status,” “Talk to an agent.”
If the same flow is also agent-level with a vague description “Handles IT stuff,” generative orchestration may fire it on unrelated IT questions. Tighten the description and consider disabling dynamic use when the flow must only run after card validation.
Troubleshooting checklist
- Open the topic action node → refresh parameters if the flow schema changed.
- Confirm Copilot Studio inputs/outputs match the flow trigger and Respond action names/types.
- Save topic, republish agent, and retest a fresh conversation.
- In the flow, verify Asynchronous response is Off on Respond to the agent.
- Reject null required inputs; stick to supported base types.
- Use the flow checker and agent activity map (generative) to see whether the planner selected the tool or the topic path ran.
- Confirm connections: end-user credentials vs maker-provided connections for run-only users, especially in CMK environments where user-provided connections may be restricted.
Design decisions for AB-620 stems
- Prefer topic + flow when the user must complete a structured multi-field form before any system write.
- Prefer agent-level flow tool when the action is a single capability the planner should discover from natural language.
- Prefer human-in-the-loop flow patterns when high-risk changes need approval (covered in the agent-flows chapters)—still return a clear status to the agent after the gate.
- Never assume “add flow somewhere” without Respond to the agent outputs the conversation can use.
Success checklist
- Flow has agent trigger + Respond action, async off, published.
- Inputs bound from variables or deliberate AI fill; no silent nulls.
- Outputs stored and used in messages or branches.
- Placement matches orchestration mode and compliance needs.
- Descriptions prevent accidental generative double-calls.
- Tested after every schema change with republish.
Mastering this skill connects conversation UX to enterprise automation—the core of “configure topics” on AB-620 Domain 1.
Which pair of flow elements is required before an agent can call an agent flow as a tool?
A regulated process must collect adaptive-card fields, validate them, call a flow, then show a fixed confirmation message. Which approach best fits?
With classic orchestration enabled, when can the agent run an agent flow tool?