Lab Β· Power Platform Advent Calendar 2026

Copilot Studio triggers

Rebuild the demo at home: an agent nobody has to ask
0minutes at most
0guided steps
0prompts typed by a user

What you will build

Contoso Procurement, a fictional team, is in the Christmas rush. Quotes and statements of work land in a SharePoint folder called Incoming. Today someone opens each one, reads it and forwards it, and in December the deadlines slip through: a quote that expires, a guest list that is due, a notice period before an automatic renewal. In this lab, nobody types a prompt: the file itself wakes the agent.

One document, from SharePoint to Teams

πŸ“„
A file landsSomeone drops a supplier document in Incoming
🚦
PDF onlyThe workflow stops anything that is not a PDF, before it costs a credit
πŸ”Ž
ExtractThe workflow reads the PDF and pulls out 11 fields
πŸ’¬
Posted in TeamsThe agent writes the summary and the points to watch
Click a step to see it.

🧠 The agent

Contoso Procurement Watcher, on the Microsoft Copilot harness. Short instructions, no tools, no knowledge, no web search. It gets one document and judges it: supplier, amount, dates, and at most three points to watch.

⚑ The workflow

Supplier documents to Teams, a Copilot Studio workflow (not Power Automate). A SharePoint trigger, a condition, Extract, an Agent node that calls the agent, and a Teams post.

Why not hand the PDF straight to the agent? The agent node takes a message, not a file. So the workflow does the reading (Extract) and the agent does the thinking (what matters, and by when).

Before you start

A test tenant, never production. The lab creates a team, a channel, a folder, an agent and a workflow, and it posts real messages in Teams.
  • A Microsoft 365 test tenant where you can create a team in Microsoft Teams.
  • A Power Platform environment with Dataverse and access to Copilot Studio, with Copilot Studio credits. One document costs about 30 credits.
  • PowerShell 7 and Azure CLI, the Azure command-line interface (az): install Azure CLI.
  • The lab files:

1The team, the channel and the folder

⏱️ About 5 minutes

  1. In Microsoft Teams, create a team Contoso - Procurement (from scratch, private).
  2. In that team, add a standard channel Supplier documents.
  3. Open the team's SharePoint site: in the team, Files, then Open in SharePoint. Go back to the root of the Documents library.
  4. In Documents, create a folder Incoming. Keep this tab open: you will drop the documents here in step 4.
  5. Unzip the Christmas supplier documents into a folder on your computer, ready for drag and drop.
Result: the team Contoso - Procurement with an empty channel Supplier documents, and an empty folder Incoming in the Documents library of its site (address https://your-tenant.sharepoint.com/sites/contoso-procurement or similar).
Plan a spare channel. Posts written by the workflow (as the Flow bot) cannot be deleted by the team owner. If you want a clean run later, point the workflow at a fresh channel instead.

2The agent, on the Microsoft Copilot harness

⏱️ About 5 minutes

  1. Put watcher-instructions.txt and create-watcher-agent.ps1 in the same folder.
  2. Find your environment URL: Power Platform admin center, Environments, your environment, Environment URL (it ends with .dynamics.com). Find your tenant identifier: Microsoft Entra admin center, Overview, Tenant ID.
  3. In PowerShell 7, from that folder, sign in and run the script:
Result: CREATED followed by an identifier, then PUBLISHED ... status=Succeeded after about 15 seconds. Run it again after editing the instructions: it updates the same agent and publishes again.
  1. Open Copilot Studio, pick your environment, Agents, then Contoso Procurement Watcher, Build tab. Check: the instructions are there, no tools, no knowledge, web search off.

The instructions are short. Three rules carry the weight:

Why simple HTML? A Teams channel post is HTML, the web page format. Markdown would show up as literal asterisks, so rule 2 asks the agent for a bold title, one field per line, a numbered list for the points to watch and an "Open the document" link.

3The workflow

⏱️ About 20 minutes

In Copilot Studio, same environment: Workflows, New workflow. Name it Supplier documents to Teams. Then add the nodes in this order.

  1. Trigger: SharePoint, "When a file is created (properties only)". Site Address: your Contoso - Procurement site. Library Name: Documents. Folder: /Shared Documents/Incoming.
  2. Condition (If/Else): File name with extension (from the trigger) ends with .pdf. Put every following node in the branch where the condition is true. The other branch stays empty: the run stops there.
  3. SharePoint, "Get file content". Site Address: the same site. File Identifier: Identifier from the trigger.
  4. Extract. Give it the File Content from "Get file content" as the document to read, and define these 11 output fields, all text: Supplier, DocumentType, Reference, Amount, Term, Validity, Deadlines, Liability, PersonalData, RenewalAndNotice, OtherClauses.
  5. Agent. Choose Contoso Procurement Watcher. In Message, paste the text below, then replace each value in braces with the dynamic value of the same name (from the trigger, or from Extract).
  1. Microsoft Teams, "Post message in a chat or channel". Post as: Flow bot. Post in: Channel. Team: Contoso - Procurement. Channel: Supplier documents. Message: the agent's answer (the result output of the Agent node).
  2. Save, Publish, and make sure the workflow is on. The editor may still show a "Draft" badge although the workflow is on: trust the workflow list.
Pick "properties only". The trigger "When a file is created in a folder" is marked deprecated. "When a file is created (properties only)" passes the file's metadata, not its text: that is why "Get file content" and Extract come next. Without them, the agent has nothing to read.
Result: six nodes in one line: trigger, condition, Get file content, Extract, Agent, Post message. The workflow is published and on.

4Drop the documents, one at a time

⏱️ About 10 minutes

One file at a time. Files dropped at the same moment arrive in one trigger run. Drop a file, wait for its post in Teams, then drop the next one.

Open the Supplier documents channel next to the Incoming folder. The trigger checks the folder about every minute; a run took 38 to 45 seconds in rehearsal. Expect the post one to two minutes after the drop.

  1. Meeting notes - Christmas market planning.txt. Nothing appears in Teams. Not a PDF: the run stopped at the condition and the agent never woke up. You can see that run, short, in the workflow's Activity.
  2. Fabrikam - Quote Q-2026-118 Christmas lights.pdf. Expected: Fabrikam Festive Lights, a quote for 400 metres of garlands, 12 illuminated reindeer and a 4 metre tree for the Christmas market stand, EUR 18,600. Point to watch: the price is valid only until 4 December 2026, and installation is on 5 December.
  3. Litware - Statement of work staff Christmas party.pdf. Expected: Litware Events, reference LW-SOW-2026-77, EUR 27,000 fixed price for 220 guests on 18 December 2026. Points to watch: a data processing agreement before 1 December (the guest list holds names, emails and dietary requirements), final numbers by 4 December or a 50 percent cancellation cost, and liability capped at the contract amount.
  4. Northwind - Framework agreement 2027 gift wrapping.pdf. Expected: EUR 48,600 a year for 2027, prices up 4.5 percent, and it renews automatically unless notice is given before 2 October 2027.
Result: three posts in Supplier documents, each with a bold title, one field per line, a numbered list of points to watch with their dates, and an "Open the document" link. No post for the text file.
The agent wrote "not stated"? That is rule 3 at work: it refuses to guess. Check in the run that Extract returned values. In the first version of this demo, the workflow passed only the file's properties, and the agent answered "PDF contents unavailable, amount not stated" instead of inventing a figure.

5Inside one run, and a schedule

⏱️ About 10 minutes

  1. In the workflow, open Activity and open the Litware run. Each node is green.
  2. Click Extract: the fields it pulled from the PDF. Then click Agent: the message it received and the answer it wrote. The fields are facts; the points to watch are the agent's judgement.
  3. Look at the cost: about 30 credits per document in rehearsal, about 24 for Extract and 6 for the agent. Measure it before you point the workflow at a folder that gets a hundred files a day.
  4. Optional: save a copy of the workflow and replace the trigger with Recurrence, every morning at 8:00. The same pattern becomes a daily digest. Event and schedule are the two kinds of trigger you will use most.

Before you turn on a proactive agent: 4 controls

A proactive agent spends credits on every run and can post in the wrong place. Nobody is there to catch it, so build the guardrails in.

  1. Scope the trigger. One folder, not the whole site. Ideally a library for the agent, not the one everybody writes to.
  2. Filter before the agent runs. Only PDFs reach the agent. A file it should ignore should never wake it.
  3. Read, never act. The agent summarises. It does not approve, sign, reply to the supplier, or move or delete the file.
  4. Watch it run. The workflow's Activity lists every triggered run: check it daily for the first week.

Lessons from building it

  • "When a file is created (properties only)" passes metadata only: read the file in the workflow before the agent runs.
  • Files dropped together arrive in one run: test one file at a time.
  • The condition on .pdf keeps text files and images away from the agent, at zero credit.
  • Teams channel posts are HTML: ask the agent for simple HTML, never Markdown.
  • Flow bot posts cannot be deleted: use a fresh channel for each clean run.
  • About 30 credits per document, and 38 to 45 seconds per run.

Clean up

  1. Turn off the workflow Supplier documents to Teams (or delete it) in Copilot Studio, Workflows.
  2. Delete the files you dropped in Incoming.
  3. Delete the agent Contoso Procurement Watcher in Copilot Studio if you no longer need it.
  4. Delete the team Contoso - Procurement when you are done: it removes the channel and the site with it.
Elliot Margot

Who built this lab?

Elliot Margot Β· Microsoft MVP (Most Valuable Professional) for Microsoft 365 Copilot and Copilot Studio Microsoft MVP badge

Based in Lausanne, Elliot builds agents with Copilot Studio and Microsoft 365 Copilot, and he would rather show them live than on slides. This lab follows his "Copilot Studio triggers" video for the Power Platform Advent Calendar 2026.

Every week he publishes Agentic Weekly, a short newsletter on what actually changes in the world of agents.