Share via


Build an agent flow with natural language

You can easily create an agent flow by conversing with Copilot using natural language to describe what you want the flow to do. Based on your description, Copilot generates a flow with a trigger and actions that you can further customize in the Copilot Studio designer. Copilot will:

  • Understand your intent and create a flow based on your scenario.
  • Set up required connections and apply the necessary parameters.
  • Respond to your requests to make changes to your flow.
  • Answer questions about your flow and Copilot Studio, such as "What does my flow do?" or "How do I access child flows?".
  • Suggest a description for the flow when you edit the flow's details.

Important

  • Copilot is new technology that's still being developed. It's optimized for use with the English language and has limited support for other languages. Parts of it might appear in English rather than your preferred language.
  • Copilot capability is powered by Azure OpenAI Service.

Create an agent flow

  1. In Copilot Studio, in the navigation pane, select Flows > New agent flow.

  2. Enter a prompt that describes what you want the flow to do in everyday language. For example, "When an email from my manager arrives, post the email subject in Teams." Read tips for writing a good prompt.

    Alternatively, select an example flow from the list. Select View all examples for the complete list of flow templates. Edit, test, and publish the flow in the designer.

  3. Select Submit. Allow a few seconds for Copilot to generate a flow based on your prompt.

  4. 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.

    For example, let's say that Copilot generated the following suggestions. Here are examples of the kinds of additional details 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.
  5. Review the apps and services that Copilot connected to your flow. A green checkmark indicates that the connection is successful.

  6. Select Create.

  7. Edit your flow, test it, and publish it in the designer.

    If you need to stop working on your flow and come back to it later, select Save draft. A banner at the top of the screen confirms that your flow is saved.

How to write a good prompt

A good prompt includes specific details about your request, including how you want your results to display. Copilot Studio lets you try out variations of prompts to help you evaluate what works best. If the initial results aren't what you're looking for, revise your prompt and run it again. Here are more tips for writing a good prompt:

  • Provide your prompt in When X happens, do Y format to get better and more accurate results.
  • Be as specific as possible. When an email arrives, I want to post the subject of the email to 'Contoso' Teams General channel is a more effective prompt than the generic I want to process an email.
  • Mention the connector if you can, like Outlook, Teams, or Forms.
  • Use the same language you would use when talking to a colleague or friend.
  • Avoid using technical terms or jargon.

Learn more in The art of the prompt: How to get the best out of generative AI. More examples are available in the prompt library. Visit the Sample Solution Gallery and in the Products list, select Copilot Studio.

Next step

Edit and manage your agent flow in the designer