How to Build Autonomous AI Agents Using Copilot Studio
Autonomous AI agents are changing how organizations automate complex workflows. Instead of relying on static rule-based scripts or manual oversight, these agents can detect events, reason over contextual information, and execute multi-step tasks independently across connected systems.
From processing inbound emails to updating CRM records and triggering follow-up actions, autonomous agents reduce operational overhead while improving speed and accuracy.
In this tutorial, you’ll learn how to build an autonomous AI agent in Microsoft Copilot Studio that monitors incoming emails, extracts lead details, updates Dataverse, and notifies your sales team automatically.
What are autonomous AI agents?
An autonomous AI agent is a software system that is built to achieve a specific goal by making decisions and taking actions on its own. Traditional automation tools follow fixed rules. Autonomous agents go further as they interpret context, respond to changing conditions, and execute multi-step tasks across systems.
At its core, an autonomous AI agent is built around five key characteristics:
- Defined objective: The agent operates toward a clearly specified goal.
- Event-driven behavior: It reacts to triggers or scheduled events automatically.
- Contextual reasoning: It analyzes available information to determine appropriate actions.
- System execution: It performs actions across connected systems such as databases, CRMs, or communication platforms.
- Minimal human intervention: Once deployed, it operates independently with limited oversight.
Now that we understand what an autonomous AI agent is, let’s look at the platform we will use to build it.
What is Copilot Studio?
Microsoft Copilot Studio is a low-code platform for building and deploying AI agents that connect with Microsoft 365 and external systems. It gives teams the tools to create agents without extensive development experience, while still supporting the security and governance standards that enterprise environments require. Here is what Copilot Studio enables:
Event-driven automation: Agents act the moment a specific condition is met, without waiting for manual input.
Knowledge grounding: Agents draw from your organization’s own data sources to make accurate, context-aware decisions.
Secure system integrations: Agents connect with enterprise systems while adhering to your organization’s security standards.
Governance and monitoring: Built-in tools keep agent activity visible, auditable, and controlled.
Let’s use Copilot Studio to build a real-world autonomous agent step by step.
Building an autonomous AI agent using Copilot Studio
Let’s build a sales lead follow-up agent that monitors your Outlook inbox for new lead inquiry emails. When a relevant email is detected, the agent extracts the contact details, creates a lead record in Dataverse, and triggers a follow-up task for the sales team in Microsoft Teams, without any manual intervention required.
Step 1: Define the agent’s objectives
Before opening Copilot Studio, take a few minutes to clearly define what your agent will do and where its boundaries are. This prevents the agent from overstepping its scope and ensures it behaves predictably.
Define the following before you begin:
Specify which inbox or folder the agent will monitor for incoming lead inquiries.
List the key details the agent needs to extract from each email, such as sender name, company, contact number, and inquiry type.
Identify where the agent will log the lead, such as a Dataverse leads table or a CRM platform.
Define what happens after a lead is logged, such as creating a Teams notification or assigning a task in Planner.
Decide when the agent should flag a lead for immediate human attention, such as high-value inquiries or specific keywords in the email.
With the objective clearly defined, you are ready to create your agent in Copilot Studio.
Step 2: Create a new agent in Copilot Studio
Once your objective is defined, log in to Copilot Studio and follow these steps:
1. On the home screen, choose the Agent mode.

2. In the Instructions field, enter a prompt that defines how the agent should behave. For example:
You are a Sales Lead Follow-Up Agent who monitors an Outlook inbox for incoming lead inquiry emails and automates the follow-up process for the sales team.When a new lead inquiry email is received, you must:- Extract key details from the email, including the sender's name, company, contact number, and inquiry type.- Create a new lead record in Dataverse with the extracted information.- Send a lead summary notification to the sales team in Microsoft Teams.- Assign a follow-up task in Planner to the relevant sales representative.Escalation rule: If the email contains high-value keywords such as "enterprise", "urgent", or "partnership", flag the lead and notify the sales manager immediately for priority handling.
3. Send this prompt to initialize the agent.

This instruction prompt acts as the agent’s core reasoning guide, shaping how it interprets documents and decides what actions to take at every step.
Step 3: Connect knowledge resources
With the agent created, the next step is to connect it to the data sources it will use to make informed decisions. These data sources are termed as knowledge resources.
- In the navigation panel, select Knowledge.
- Select Add Knowledge and choose Dataverse
Search for and select the following standard tables:
- Account: To store company information associated with the lead
- Contact: To store the individual contact details extracted from the email
- Task: To log and track follow-up actions assigned to the sales team
Save to confirm your knowledge sources.
Step 4: Connect agent tools
Tools define what actions your agent can perform once it detects a new lead email. In the navigation tab, scroll to the Tools section and add the following:
1. Office 365 Outlook tool
a. Choose the Get Email action to allow the agent to read and extract content from incoming emails. Choose the Get email (V2) option.
b. Link the email ID and confirm
2. Microsoft Dataverse tool
For our use case, we need two Dataverse tools:
a. Add a new row to selected environment: This is the primary one we need, it allows the agent to create a new contact or account record in Dataverse when a lead email is received.
b. List rows from selected environment: This is useful to check if the lead or contact already exists in Dataverse before creating a duplicate record.
So, the agent would first use List rows to check for an existing record, and if none is found, use Add a new row to create one.
3. Microsoft Teams tool
a. Choose the Post a message in a chat or channel action to allow the agent to notify the sales team with a lead summary.
b. Connect with your email ID to confirm.
c. Select add and configure.
4. Microsoft Planner tool
a. Choose the Create a task action to allow the agent to assign a follow-up task to the relevant sales representative.
b. Select Add and configure to confirm.
Once all four tools are added, your agent has everything it needs to read, log, notify, and assign leads automatically.
Step 5: Configure event-based trigger
The next step is to tell the agent when to act. The agent will automatically start processing whenever a new lead inquiry email arrives in your Outlook inbox.
1. In the Overview tab, scroll down to the Triggers section.

2. Select Add Trigger and choose When a new email arrives (V3) from Office 365 Outlook.

3. Configure the trigger settings:
- Folder: Select the inbox or a specific folder you want the agent to monitor.
- Subject Filter: Add a keyword such as “inquiry” or “lead” to ensure the agent only processes relevant emails.
- From Filter: Optionally specify a sender domain or address to narrow down which emails the agent responds to.
4. Select Save to confirm your trigger settings.
Once configured, the agent will begin processing any new lead inquiry email that arrives in the monitored folder without any manual intervention.
Step 6: Implement lead extraction and logging logic
Once the trigger is configured, review the agent’s instructions that were auto-generated in Step 2 to ensure the extraction and logging logic is accurate. Copilot Studio automatically generates a set of instructions based on your agent’s purpose, but you may need to make one small update to include a duplicate check before creating a new record.
In the Instructions section, locate the Create Lead Record in Dataverse step and update the action to include the following logic:
Use `Dataverse list rows` to check if a contact with the same email address already exists. If no record is found, use `Dataverse add a new row` to create a new lead record with the extracted details. If a record already exists, skip creation and proceed to notify the sales team.
This ensures the agent does not create duplicate records in Dataverse every time the same lead sends a follow-up email.
Select Save to update your instructions.
Step 7: Test the agent
With everything set up, it’s time to test the agent before publishing it to ensure it behaves as expected.
1. In the top navigation bar, select Test to open the test panel.
2. Send a sample lead inquiry email to the monitored Outlook inbox.
3. Observe the agent’s activity in the test panel and verify the following:
- The email is detected and the trigger fires correctly.
- Lead details such as name, company, and inquiry type are extracted accurately.
- A new record is created in Dataverse without duplicates.
- A notification is posted to the designated Teams channel.
- A follow-up task is created in Planner.
- High-value keywords trigger an escalation message to the sales manager.
4. If any step fails, review the relevant tool configuration and update the instructions accordingly.
Step 8: Publish and monitor the agent
Once testing is complete and the agent is behaving as expected, you are ready to publish it and make it live.
Publishing the agent
1. In the top navigation bar, choose Publish.
2. Review the publishing settings and select Publish to make the agent live.
Monitoring the agent
1. Navigate to the Analytics tab to track the agent’s performance after deployment.
2. Review the following metrics regularly:
Run history: To see a log of every trigger event and the actions taken.
Success rate: To track how many leads were processed without errors.
Escalations: To monitor how many leads were flagged as high priority.
3. If the agent encounters repeated errors on a specific step, revisit the relevant tool configuration and update the instructions accordingly.
4. Use feedback from the sales team on notification clarity and task assignment accuracy to refine the agent over time.
Once deployed, autonomous AI agents run silently in the background, handling complex workflows without any manual intervention.
Use cases of autonomous AI agents
Autonomous AI agents are not limited to sales workflows. Once you understand how to build one, the same approach can be applied across virtually every function in an organization.
Here are some common use cases across different business functions:
Operations: Orchestrate multi-step workflows, manage document lifecycles, and route approvals without manual handoffs.
HR: Screen incoming resumes, extract candidate details, and create records in your applicant tracking system the moment an application arrives.
Finance: Validate invoices against purchase orders, flag discrepancies, and monitor compliance thresholds in real time.
Customer support: Triage incoming tickets, categorize issues by priority, and ensure SLAs are met without manual case assignment.
Sales: Qualify inbound leads, enrich contact records, and trigger follow-up sequences the moment a prospect shows interest.
Across all these scenarios, the common thread is the same: autonomous agents reduce the time between an event occurring and the right action being taken, cutting down on decision latency and freeing teams from repetitive operational overhead.
Autonomous AI agents vs chatbots
Although both use AI, autonomous agents and chatbots serve different purposes.
- Chatbots respond to user queries in conversational interfaces.
- Autonomous AI agents act independently when triggered by events, executing multi-step workflows without waiting for human input.
For example, a chatbot might answer a sales question. An autonomous agent, on the other hand, could automatically process an incoming sales inquiry, create CRM records, notify the team, and assign follow-up tasks without anyone initiating the process.
This distinction makes autonomous agents more suitable for workflow automation and enterprise operations.
Conclusion
Autonomous AI agents are software systems that detect events, reason over information, and take action across connected systems without waiting for human input. Built using platforms like Microsoft Copilot Studio, they combine triggers, tools, and instructions to execute end-to-end workflows independently. Unlike chatbots or basic automation, autonomous agents can handle multi-step processes, make context-aware decisions, and escalate when needed, making them one of the most practical ways to reduce manual work and improve operational efficiency across any organization.
To build a stronger foundation in how autonomous agents work, check out Codecademy’s Intro to AI Agents course.
Frequently asked questions
1. What is an autonomous agent in Copilot?
An autonomous agent in Copilot is an AI-powered system that detects events, makes decisions, and takes action across connected systems without human input. Unlike a chatbot, it operates independently, executing multi-step workflows such as processing emails, updating records, and sending notifications based on a defined objective.
2. What is the main goal of Copilot Studio?
The main goal of Copilot Studio is to provide a low-code platform for building and deploying AI agents that connect with Microsoft 365 and external systems. It allows teams to automate complex business workflows without requiring extensive development experience.
3. What are the actions in Copilot Studio?
Actions in Copilot Studio are the tasks an agent performs when a trigger fires. These include reading emails, creating records in Dataverse, posting messages in Teams, and assigning tasks in Planner. Actions define what the agent does once it detects an event.
4. Is Copilot Studio the same as Power Automate?
No. While both are part of the Microsoft ecosystem, Power Automate focuses on rule-based workflow automation, whereas Copilot Studio enables AI-driven agents that reason over context and execute dynamic, multi-step actions autonomously.
'The Codecademy Team, composed of experienced educators and tech experts, is dedicated to making tech skills accessible to all. We empower learners worldwide with expert-reviewed content that develops and enhances the technical skills needed to advance and succeed in their careers.'
Meet the full teamRelated articles
- Article
ChatGPT Agents: 3 Powerful Ways to Automate Tasks with AI
Learn ChatGPT agents with 3 practical examples. Automate tasks, boost productivity, and build your own AI agent. - Article
How to Build Agents with Vertex AI Builder
Build AI agents with Vertex AI Agent Builder. Learn to use Agent Garden, ADK, and Agent Engine to deploy custom agents. - Article
How to Build AI Agents with Gemini 3 in 10 Minutes
Learn how to build AI agents with Gemini 3 from setup to deployment using real-world data analysis and Python code.
Learn more on Codecademy
- Understand AI agents from the ground up in this beginner-friendly course covering autonomous systems and agentic workflows.
- Beginner Friendly.< 1 hour
- Discover AI agents in Excel, Power BI & Tableau. Learn use cases, limitations & view real demos to decide if Copilot or Tableau Agent fits your workflow.
- Beginner Friendly.1 hour
- Learn to build autonomous AI agents that use tools, make decisions, and accomplish complex tasks using LangChain and agentic design patterns.
- Includes 6 Courses
- With Certificate
- Intermediate.6 hours