Build and publish a standalone workflow
A standalone workflow in Copilot Studio exists independently of any single agent. You create it once, publish it, and then add it as a tool to any agent that needs it. In this unit, you create a workflow with the trigger and response steps that any agent-callable workflow requires.
With her contract defined, Priya creates the workflow that sends task notifications. She starts in the Copilot Studio Workflows experience.
Navigate to the Workflows experience
In Copilot Studio, select Workflows in the left navigation. This area lists all workflows in the current environment, shows their status, and lets you create, edit, and publish workflows.
Note
Workflows are stored in the current Power Platform environment. If your organization requires workflows to be created inside a solution, verify the correct solution context before creating a workflow, or move the workflow to a solution after creation. Check with your administrator if you are unsure.
Create a new workflow
Select New workflow. In the workflow designer, add the required trigger and response action:
- When an agent calls the flow: The trigger.
- Respond to the agent: The response.
These two steps are always present in an agent-callable workflow. You configure inputs in the trigger and outputs in the response. Connector actions go between them.
Configure the trigger step
Select the When an agent calls the flow step to expand it. Select + Add an input to add each input from your contract.
For each input:
- Select the input type from the list, such as Text.
- Enter the Input name exactly as you defined it in your contract.
- Enter the Description that explains what value the agent should provide.
After you add all inputs, the trigger step shows each input with its name, type, and description. These values become available as dynamic content in every subsequent step in the workflow.
Name and describe the workflow
Before saving, give the workflow a clear, meaningful name and description. These values appear in the tool catalog when you add the workflow to an agent, and the agent uses the description to decide when to select it.
- Select the Overview tab above the designer canvas.
- In the Details section, select Edit.
- Update Workflow name to a name that states what the workflow does. For example,
Send Task Notification Email. - For Description, write a sentence that explains what the workflow does and when to use it. For example,
Sends a formatted task notification email to a specified recipient with the task title, details, and due date. - Select Save.
Save a draft
Return to the Designer tab. Select Save draft to save your progress. A draft workflow isn't available to agents until you publish it.
At this point, the workflow has a trigger with defined inputs and a response step with no outputs yet. The connector action that sends the email goes between these two steps. An agent-callable workflow must also respond in real time. Under Networking in the Respond to the agent action settings, keep Asynchronous response set to Off.
Understand the workflow status lifecycle
A saved workflow remains in Draft status and isn't available to agents until you publish it. During publication, its status changes to Publishing, followed by Ready when it becomes available as a tool or Error if publication fails.
Publish the workflow after you finish configuring the connector action and response outputs. Until the status is Ready, the workflow doesn't appear as an available tool when you add tools to an agent.
After defining the trigger, configure the connector action and response outputs before you publish the workflow.
Add a connector action
A connector action interacts with an external service. Priya adds the Send an email (V2) action from the Office 365 Outlook connector between the trigger and response steps.
- Select the + icon between When an agent calls the flow and Respond to the agent.
- Search for
OutlookorSend an email. - Select Office 365 Outlook, and then select Send an email (V2).
- If prompted, sign in with a Microsoft 365 account that has an Outlook mailbox and permission to send email.
Map dynamic content
Dynamic content connects trigger inputs to fields in later actions. Configure the email action as follows:
In To, open the dynamic content picker and select Recipient Email.
In Subject, combine
Task notification:with the Task Title dynamic content.In Body, combine static labels with the trigger inputs:
Task notification Task: [Task Title] Details: [Task Details] Due date: [Due Date] This notification was sent by the Contoso Task Notification Agent.
Replace each bracketed label with its corresponding dynamic content reference. When the workflow runs, the values supplied by the agent replace these references.
The connection used by Send an email (V2) determines which mailbox sends the message. A creator connection sends from the workflow creator's mailbox. In production, work with your administrator to determine whether a service account or shared mailbox is more appropriate.
Configure the response
Select Respond to the agent, and add the outputs that the agent uses after the email action finishes:
- Add a Text output named
Statuswith the static valueEmail sent. - Add a Text output named
Confirmation. CombineTask notification sent to:with the Recipient Email dynamic content. - Under Networking in the response action settings, confirm that Asynchronous response is set to Off.
Agent-callable workflows must respond in real time and return within the action limit. Keep actions before Respond to the agent focused on the result the agent needs.
Publish the workflow
Select Save draft, and then select Publish. The workflow becomes available to agents after its status changes to Ready. If the workflow doesn't appear when you add a tool, confirm that it:
- Uses When an agent calls the flow and Respond to the agent.
- Has Asynchronous response set to Off.
- Is published and has a Ready status.
After publication, you can add the workflow to an agent as a tool. When you change the workflow later, save and publish the updated version before testing the agent again.