Add and configure a workflow tool for an agent
A published workflow is available to add as a tool to any agent in the same environment. In this unit, you add the workflow to an agent, configure how the agent fills the workflow's inputs, require end-user confirmation before the workflow runs, and reference the tool in the agent's instructions.
With her workflow published, Priya opens the Contoso Task Notification Agent and adds the workflow as a tool.
Add a workflow to an agent
Open the agent in Copilot Studio and select the Build tab. Select the Tools section to open the Add a tool dialog:
- Select the Workflows filter to show only workflow tools.
- Select the published workflow from the list to add it to the agent.
- In the Tools section, select the workflow to open its configuration panel.
Copilot Studio adds the workflow and opens the tool configuration panel.
Configure the tool name and description
The tool name and description help the agent decide when to select this tool over others. Review and update both fields in the configuration panel.
- Name: Use a verb phrase that states what the tool does. For example,
Send task notification emailis more informative than the workflow's internal name. The agent reads this name when reasoning about which tool matches the user's request. - Description: Write a sentence that explains what the tool does, when to use it, and what it needs. For example:
Sends a formatted task notification email to a specified recipient. Use when the user asks to send a notification and the recipient, title, details, and due date are available.
The description is the most important field for tool selection. A vague description causes the agent to select the wrong tool or miss opportunities to use it.
Configure inputs
The Inputs section of the tool configuration panel lists each trigger input defined in the workflow. For each input, set Fill using to tell the agent how to provide the value:
| Setting | Use when |
|---|---|
| Dynamically fill with AI | The value comes from the conversation. The user provides it or the agent extracts it from context. |
| Custom value | The value is always the same regardless of the conversation, such as a fixed region or template ID |
For a notification workflow where the recipient, task title, task details, and due date come from the conversation, set each input to Dynamically fill with AI. The agent uses the input description from the workflow trigger to find the value in the conversation. If the value is missing, the agent asks the user before calling the workflow.
Confirm that the description on each input is accurate and specific. If the input description says only Email address, specify that the workflow requires a complete work or school email address, and then republish.
Require end-user confirmation
For actions with consequences, such as sending an email, creating a record, or posting a message, require the user to confirm before the workflow runs. In the tool configuration panel:
- For Ask the end user before running, select Yes.
- Optionally update the confirmation prompt to show the user what is about to happen. For example:
I'm about to send a task notification email. Please review the details and confirm.
When the agent is ready to call the tool, it presents the confirmation message and waits for the user to approve or cancel. If the user approves, the workflow runs. If the user cancels, the agent acknowledges the cancellation without running the workflow.
Requiring confirmation is especially important when:
- The action sends a message or email to another person.
- The action creates or modifies a record in a system of record.
- The action is difficult or impossible to undo after it runs.
Configure the completion behavior
In the Completion section, choose how the agent responds after the workflow runs:
| Option | Behavior |
|---|---|
| Write the response with generative AI | The agent uses the workflow outputs to compose a natural language response |
| Show a message | The agent displays a fixed text message |
For a notification workflow, Write the response with generative AI lets the agent incorporate the Status and Confirmation outputs into a natural, readable response.
Reference the tool in agent instructions
The agent uses its instructions to decide how and when to call tools. After configuring the tool, return to the Build tab and update the agent's Instructions. Add a step that explains when to call the tool and what to do first.
Use the / shortcut in the instructions editor to insert a direct reference to the tool by name. For example:
When the user asks to send a task notification and all required details are confirmed, use the Send task notification email tool.
A direct reference reinforces the agent's tool selection and helps it associate specific request patterns with this workflow.
Save the agent
Select Save after completing the tool configuration and updating the instructions. The agent is now ready to test.
Note
Before testing, review the configuration from the agent's perspective. Does the description explain the right scenario? Are the input descriptions specific enough for the agent to fill them from a realistic conversation? Does the confirmation prompt give the user enough information to make an informed decision?