A pattern I see often: a team has dependable Power Automate Desktop flows working against legacy applications, and now wants to add a Copilot Studio agent. The instinct is to keep the robot in charge and have it call the agent whenever it needs “the AI bit”.
I’ve found the opposite works better. Put the agent at the front and let it call the robot.
What went wrong the first way
On a recent build, the desktop flow called the agent through the Copilot Studio connector’s execute-agent actions. When we moved to the newer generation of Copilot Studio agents, those actions no longer worked with them. Rather than wait for a fix, we turned the design around, and the result was cleaner anyway.
The inverted pattern
The agent becomes the front door. It receives the request, works out what’s being asked and gathers what it needs. When work has to happen inside a desktop application, it calls a tool: a cloud flow that runs the desktop flow and hands back the result. The desktop flow does what robots are good at, which is precise, repeatable steps in a user interface.
- AI agent
- People
- Robot and systems
Why it’s better
- Each part does what it’s good at. The agent handles messy language and decisions. The robot handles exact clicks and keystrokes.
- The robot stays testable. The cloud flow defines exactly which inputs the desktop flow accepts and what it returns, so you can test it on its own.
- The agent can recover. If the robot reports a failure, the agent can retry, ask the user for missing details or hand over to a person.
- You can change one side without breaking the other. Swap the model or rework the conversation without touching the robot.
Things to watch
- Desktop flows need a machine, a runtime and the right licence. Plan where they run before you design the conversation.
- Agents expect tools to answer promptly. If the robot’s work takes a while, return a “started” status and report the outcome separately.
- Return structured outputs, such as a status, a message and any data, so the agent can explain failures in plain words.
- Put an approval step before anything irreversible, exactly as you would for an agent working on its own.
If you have desktop flows doing reliable work today, you don’t need to rebuild them to add AI. Wrap them as tools and let an agent decide when to use them.