Share via


Quickstart: Create and deploy a classic chatbot

Note

This article only applies to the Microsoft Copilot Studio app for Microsoft Teams. To create your first chatbot in Copilot Studio, see Quickstart: Create and deploy an agent.

Copilot Studio empowers anyone in the organization to build chatbots in Microsoft Teams. The chatbot has built-in natural language processing (NLP) and a no-code graphical interface. With our latest Teams integration, you can create, author, test, and publish your chatbot to Teams within the Microsoft Teams interface.

When you create a chatbot, consider:

  • The types of questions someone might ask
  • The different ways a question is asked
  • The expected answers
  • Whether or not a user has follow-up questions or concerns

To help you get started making human resource (HR) chatbots, this quickstart shows you how to:

  • Map your scenario and needs to align with what a chatbot can do
  • Create a chatbot in the Copilot Studio app in Teams
  • Build and enhance topics that answer common HR-style questions
  • Test, publish, and share the chatbot with your organization

HR Support Bot is a friendly question and answer chatbot that brings a support professional expert from the HR team, when HR personnel are unable to help. An employee can ask the chatbot a question and the chatbot responds with an answer if the chatbot has content for it.

If the chatbot doesn't have an answer, the employee can submit a query. The query is sent to a predetermined team of experts who respond to query notifications.

Scenario

You work in human resources (HR) at Contoso and need to build an HR support chatbot in Microsoft Teams. The chatbot answers common HR questions, such as employee time-off, with relevant information from the company's internal knowledge base. The chatbot contacts HR experts and notifies them that an employee needs assistance for uncommon scenarios.

Once the chatbot is published, Contoso employees can access HR information in Teams without needing to search the company's intranet.

Install the Copilot Studio app in Microsoft Teams

Start by launching the Copilot Studio app in Teams:

  1. Go to the Teams app store and search for "Microsoft Copilot Studio."

  2. Select Add or Open, if you already added it, for the Microsoft Copilot Studio app.

The app opens to the Copilot Studio home page. Teams users can build chatbots here without leaving Teams.

Tip

Select the three dots () in the side bar of Teams to see your apps. Select and hold (or right-click) the Microsoft Copilot Studio icon and select Pin. The Microsoft Copilot Studio app appears in your side bar. You can now return to the app more easily.

Create a new chatbot in a team

  1. Select Start now on the Home page.

  2. Pick which team manages the chatbot, and select Continue. You can create a new team if necessary, before you add a chatbot to it.

  3. Select the desired language. For more information about choosing a language, see Language support.

  4. Enter a name for your chatbot—for example, "HR Support Bot."

  5. Replace the default icon with a more representative one, if desired.

  6. Add suggested prompts, if desired.

  7. Select Create.

Build an employee time-off topic for common time-off queries

A chatbot comes with a collection of topics that defines how it interacts with users. Let's build a topic to answer employee questions about taking time off.

  1. Select Topics in the left pane.

  2. Select New topic > From blank.

  3. Select the Trigger Phrases box to add phrases.

  4. Add trigger phrases. For example, enter the following phrases:

    • Need information on time off
    • I need help with time off
    • How many days of paid vacation do I have
    • What are the national holidays
    • I need extended leave

    Trigger phrases for each topic define the ways users ask questions about that topic. These phrases are how we expect employees to ask about time off.

    Copilot Studio comes with built-in natural language capabilities. You only need to define a few trigger phrases about time-off and the chatbot can accurately trigger the topic based on the employee's input.

  5. Close the Trigger phrases panel when you're done. The Trigger Phrases node shows the phrases.

  6. Select Details on the toolbar.

  7. Name the topic "Employee time off" and enter an appropriate description.

  8. Close the Details panel.

  9. Define how the chatbot interacts with employees.

  10. Select Save. Your new topic becomes available.

Define how the chatbot interacts

  1. Enter the following text in the existing message node: "I can help with questions related to time-off."

    As an HR employee, you know the most common time-off questions are about paid vacation time and national holidays.

  2. Select the Add node (+) icon below the message node, then select Ask a question to add a question node to the topic.

  3. Enter "What information are you looking for?" in the Ask a question text box. The employee might ask this question.

  4. Under Options for user, add "Paid vacation" and "National Holidays" as two options.

    Add options for paid vacation and national holidays.

    User choices are stored in a variable and the topic branches off, based on the option the user chooses. You can rename the variable to track it better in the topic.

  5. On the variable, under Save response as, select the pencil icon to edit the variable properties.

  6. The Variable properties panel opens. Rename the variable TimeOffType. Close the Variable properties panel and you see the changes reflected on the authoring canvas.

    Multiple options are shown after a question node.

    You can add different responses for each option. For paid vacation, the chatbot can point employees to an internal HR website to look up paid time-off policies.

  7. Add a message node for the Paid vacation branch with this message to the user: "For paid vacation time-off, go to www.contoso.com/HR/PaidTimeOff to submit time-off requests."

  8. Add a node by selecting the Add node (+) icon to end the conversation with a survey. Select End the conversation, then End with survey. This survey is the customer satisfaction survey prebuilt in the chatbot for use in topics.

  9. In the National Holidays path, add a message node with the following text:

    National holidays for 2020:
    -   New Year's Day: January 1st
    -   Memorial Day: May 25th
    -   Independence day: July 4th
    -   Labor Day: September 7th
    -   Thanksgiving: November 26th - 27th
    -   Christmas Eve and Christmas Day: December 24th - 25th
    
  10. End this path in the topic with a survey as well. Add a node by selecting the Add node (+) icon then End the conversation and End with survey.

 Screenshot that shows the topic has an introductory message, followed by a question node with two options. Each option ends with a message and then a survey.

Test your chatbot

Copilot Studio comes with a built-in test pane that lets you test the chatbot in real time.

  1. To open the test panel, select Test bot on the toolbar.

  2. Enter "I need time off information."

    Even though I need time off information doesn't match any trigger phrases exactly, Copilot Studio processes the user's input and triggers the employee time off topic.

    As you chat with the chatbot, you see where it is in the conversation in real time by following the green highlights.

  3. Select Paid vacation.

    The topic branches off based on the user's response. You can open the TimeOffType variable to see the value of Paid time-off by the user. However, what happens if the user is looking for national holidays in their inquiry? The user might feel annoyed if the chatbot asks them to repeat themselves. Let's give it a try.

  4. At the top of the test pane, select the Reset icon.

  5. Enter "Need information on national holidays."

    The chatbot bypasses its response question on vacation type and directly provides information on national holidays. This behavior happens because Copilot Studio supports entity extraction and can determine that the user asks about national holidays.

    Screenshot that shows how the AI knows what the user is asking.

Enhance the topic to handle complex queries by escalating to HR experts

Now that you performed the basics, you can add a more complex "Extended leave" option to the topic.

  1. Return to the topic you created.

  2. In the Question node, add an option named "Extended leave."

    Screenshot that shows how to add an option to the question node.

    Since each employee's personal situation is different, questions about extended leave require a discussion with an HR expert You can build the chatbot to connect HR experts with your employees.

  3. Add a message node that says "Extended leave needs HR expert approval. Let me connect you with them."

    Copilot Studio chatbots can take actions by adding actions into a topic. In this example, you add a previous basic action that notifies an HR expert. This basic action sends an adaptive card to the HR expert channel in Teams to let experts know a user needs them to reach out.

    You can create the basic action to send a message to a Teams channel and then call it with the appropriate input.

  4. Add a question node asking for a description for the issue and add the text "How would you describe the issue?"

  5. Save the description in a variable named Description.

    Screenshot that shows how to add a question node with the answer as a variable called Description.

  6. Add a node under the question and select Call an action.

  7. Select Basic action and then create new flow, which launches Power Automate.

  8. Choose the template Send a message to a Teams channel, then select Continue.

    The flow template takes in two inputs from the chatbot, the Subject (title for the message) and Message text (actual message) to post to the channel.

    1. Under the Post a message (v3) flow definition, select the Team ID and the Team channel ID where the message should be posted.

    2. (Optional) Add text to the message, in addition to the description entered by the user, and complete the Message field.

    3. Give the flow a name and save it.

    4. Close the flow authoring canvas.

    You return to the authoring canvas. You can now add an action and call this newly created flow.

  9. Pass in the variable you created earlier called TimeOffType for the Subject and the Description gathered in the chat. When the flow posts a message on the Expert channel, it shows Extended leave as the title and the message defined in the flow.

    Tip

    Copilot Studio is directly integrated with Teams, so the chatbot knows which user from Teams it's chatting with. This feature allows chatbot authors to build personal and customized chatbot responses.

    To use the name of the person chatting with the chatbot, there's a predefined variable named bot.UserDisplayName that can be used like any other variable.

    You can let the employee know their request notified the experts, who will reach out to them soon.

  10. Add a message node with the message We notified the expert. They'll reach out shortly.

  11. End the conversation with a survey.

  12. Save the topic.

You can add more topics so that HR Support Bot can answer more questions from Contoso employees.

Tip

Always test your chatbot to ensure it's working as expected for the best employee experience. You see a message posted to the Teams channel when the flow executes in the test canvas.

Publish your chatbot

Publishing the chatbot makes the latest updates available to users.

In the navigation menu, select Publish. Select Publish again.

You need to do a few more actions to make the chatbot available to employees.

Tip

If you're already in a conversation with the chatbot, you can type "start over" after publishing your changes. This restarts the conversation with the latest content.

Make your chatbot available to other employees

  1. On the Publish page, select the option to open your chatbot. You can test your chatbot before sharing it.

  2. Select the option to make your chatbot available to others. The configuration panel for the Teams + Microsoft 365 channels appears.

    1. Edit details for your chatbot.

    2. Share your chatbot with your team.

      Viewing the chatbot in the app store is a workaround to test it, since admin approval isn't required and avoids any spam to the admin.

    3. Once you're fully satisfied, share the chatbot with your organization, which requires admin approval.

    Employees can now find your published chatbot in the Teams app store.

Edit chatbot details

In the customization pane, you can edit the chatbot icon that displays in Teams and change the short and long descriptions for your chatbot. These settings are prepopulated with starter content, but can be customized.

Share your chatbot with your team

  1. Select Add to <your team>. A panel appears where you can configure how your chatbot greets your team members.

  2. Select Add. A message indicates that the chatbot is available to the team. You can close the configuration panel.

Share your chatbot with your organization

Sharing your chatbot with the entire organization makes it appear in the Built for your org section of the Teams app store. Access requires admin approval.

  1. Select Submit for admin approval.

  2. Confirm the chatbot icon, short description, and long description are correct.

  3. Confirm you want to share the chatbot with everyone in the organization.

  4. Submit for admin approval. This part of the process can't be completed right away and requires follow up with the admin for approval.

Find your chatbot in the Teams app store

An employee named Melissa can find the chatbot you built in the Teams app store.

Depending on how you shared your chatbot, Melissa can find it either in the Copilot extensions section or the Built for your org section of the Teams app store. For a chatbot to appear in the Built for your org section, it must be approved by an admin first.

Melissa selects the chatbot app and selects Add for me. The chatbot appears in the Teams side bar.

The Greeting topic automatically welcomes Melissa.

Tip

You can edit the Greeting topic to have a custom welcome message.

Employee chats with the chatbot to ask about time-off

Melissa needs time-off in July and August for personal reasons and enters Need time-off information. Melissa selects Paid vacation and a website appears where she can learn more about paid time-off.

The chatbot then gathers customer satisfaction data and ends the conversation.

Screenshot shows how the user can talk with the chatbot, similarly to a Teams chat.

Melissa reviews the HR site for paid time-off and understands she needs an extended leave. Melissa returns to the chatbot and types I need extended leave.

The chatbot lets Melissa know that an HR expert is needed for the extended leave request and asks Melissa for a description of the issue.

The chatbot notifies an expert, who will reach out to Melissa shortly.

Return to the author's view and go to the HR team's experts channel.

You see the chatbot ran the flow you added earlier and posted Melissa's request to the channel.

Screenshot that shows the chatbot output a message into the Teams channel about extended leave.