Hi,
I'm building a contracts assistant using Microsoft Fabric Data Agent (MCP) + Copilot Studio, and I'm stuck on getting a custom flow (created inside Copilot Studio) to run as a tool from the agent.
I have a Data Agent in Fabric connected to a Lakehouse table, this data agent is exposed to Copilot Studio as an Agent tool. In Copilot Studio I created another agent that:
-
Uses a Fabric Data Agent to generate NL2SQL queries from natural-language questions.
-
Returns a preview table with sample rows.
-
Displays the exact SQL query that can be used to retrieve the full result set.
-
After showing the preview, the agent asks the user if they want to download the full data to OneDrive.
-
If the user answers "yes", a custom tool is triggered that:
-
Receives the agent’s last message (System.LastMessage.Text),
-
Parses and extracts the SQL query from that message,
-
Executes the query against Fabric, and
-
Saves the full result set as a CSV file in the user’s OneDrive.
If I test the flow directly in Copilot Studio (manually pasting a sample message that contains the SQL query), it runs successfully and creates the CSV in OneDrive. I can see these runs under Activity for the flow. However, when I use my Copilot Studio agent and ask the agent to download the data to my OneDrive, I get only a generic error in the chat:
Error code: SystemError. Conversation ID: <guid>. Time (UTC): <timestamp>
And importantly: no new run appears in the flow's Activity. So it looks like the flow/tool is never actualy triggered.
What I've already checked:
- The flow is listed as a tool and is enabled (condition set to "Agent may use this tool at any time")
- The flow plan is "Copilot Studio" and status is "Activated".
- My agent is running in Copilot Studio using the same tenant/account that owns the flow and OneDrive
- I can manually run the exact same SQL on the Fabric endpoint and it returns rows (so it's not an empty result causing issues).
Why would the agent show SystemError but the flow never appear in Activity? Is there anything else I must configure? Is there any way to get more detailed logs about why the tool call failed before reaching the flow?
If it helps, I can share screenshots of the flow design and configuration. Any guidance or examples of a similar setup would be very helpful.
Thanks!