Create agent flows by using natural language

Completed

Now that you know what agent flows are and how you can use them, let's dive deeper into the options for designing them in Microsoft Copilot Studio.

The simplest way to create an agent flow is by using Copilot to describe what you want the agent flow to do. Based on your description, Copilot generates a flow that includes the necessary triggers and actions.

For example, you can tell Copilot: Whenever I receive a new email that includes attachments, add the attachments to my OneDrive folder. This prompt creates an agent flow in which an incoming email is the trigger, and uploading attachments to OneDrive is the action. You can continue to tell Copilot what you want to do, and it updates your agent flow.

Screenshot of an agent flow that saves email attachments to OneDrive and sends a confirmation email.

Write good prompts

When you're using Copilot, the key to success is to use good prompts. Provide specific details about your request, including how you want your results to appear.

Keep the following points in mind when you're entering prompts to create agent flows in Copilot Studio:

  • Provide your prompt in When X happens, do Y format: This format gives you better and more accurate results. For example: When an email arrives, send a notification in Teams.
  • Be as specific as possible: When an email arrives, I want to post the subject of the email to the 'Contoso' Teams General channel is a more effective prompt than the generic I want to process an email.
  • Specify the connector to use: Try to mention the connector if you can, like Outlook, Teams, or Forms. For example: Send a notification in Microsoft Teams.
  • Phrase as if you were speaking to person: Use the same language that you use when talking to a colleague or friend.

To learn more about using prompts, see The art of the prompt: How to get the best out of generative AI.

You can find more examples in Sample Solution Gallery. Go to the Products list and select Copilot Studio.

Build an agent flow

To create a new agent flow through natural language, go to Flows and select New agent flow.

When you use Copilot to create an agent flow, you can either:

  • Enter your own: Provide a prompt in everyday language that describes what you want the flow to do. For example: Get employee benefits information from Workday. Identify if the employee has transportation benefits. If they do, send an email reminder of benefits. If they don't, end the flow.
  • Create from an example: As you type, a list of possible examples appears. At any time, you can select an example from the list.

Screenshot of suggested flow descriptions for sending emails based on various triggers.

Copilot creates a flow suggestion, including steps and connectors to use, based on your description. If you're satisfied with the flow that Copilot generated, select Keep it and continue. If you want to make changes, enter more information in Add more details for Copilot to work with, and then select Add more details.

The following table shows example Copilot-generated suggestions and the kinds of extra details that you can provide:

Copilot-generated flow suggestion Add this detail
When an email arrives from mbowen@contoso.com, post in Teams. I want to send the email subject to a Teams channel.
When an item is created in SharePoint, send me a mobile notification. I don't want to receive a mobile notification. Send me an email instead.

As you work on your flow, if you find that you need to stop working and come back to it later, you can select Save draft at any point.

For more information and step-by-step instructions, see Build an agent flow with natural language.