# Automate Shared Mailbox Triage with Power Automate and AI Prompts

> Build a Power Automate flow that reads new shared mailbox emails, asks an AI Builder prompt to classify them, routes them by category and adds human review for uncertain cases.

Source: https://www.epifive.com/blog/ai-email-triage-shared-mailbox-power-automate · Published 2026-10-25 · EpiFive

## Key takeaways

- The Office 365 Outlook trigger When a new email arrives in a shared mailbox (V2) starts the flow, and you need one flow for each shared mailbox.
- The Run a prompt action from AI Builder takes email text as an input and returns text that a Switch or Condition can use to route the message.
- The connection account must be a member of the shared mailbox, and permissions can take about two hours to replicate after you grant access.
- Ask the prompt to answer with exactly one label from a fixed list, and send anything outside the list to a human queue.
- Add Approvals review and measure results before letting the flow move or reply to mail unattended.

To triage a shared mailbox with Power Automate, start a flow with the Office 365 Outlook trigger "When a new email arrives in a shared mailbox (V2)", pass the subject and body to an AI Builder "Run a prompt" action that returns one category label, and then use a Switch to move, forward or reply to the message according to that label. Send anything the prompt cannot classify to a person, and review results before you automate more.

## Who this is for and what you will have

This guide is for IT and operations teams that receive requests in a shared mailbox such as `support@contoso.com` and want to sort them into queues without reading each one first. By the end you will have a working flow design with a fixed category list, routing, a human review path and a list of the limits and errors you are likely to meet.

The pattern uses the standard Outlook connector and a prompt. Check the licence and availability notes in the prerequisites before you build, because prompts are limited to some regions and can be throttled.

## Prerequisites

- A Microsoft 365 shared mailbox, and an account that is a member of it. Microsoft documents that the account used by the connection must be a member of the shared mailbox.
- Permissions that have replicated. After you grant access, Microsoft says it can take about two hours to replicate.
- Access to Power Automate and to AI Builder prompts. Microsoft notes that prompts run on GPT models powered by Azure OpenAI Service, that the capability is limited to some regions, and that it might be subject to usage limits or capacity throttling.
- A licence that covers AI Builder credits. Power Automate Premium and Process licences each include 5,000 AI Builder credits per month according to Microsoft's licence table, and prompt usage consumes credits. See [Power Automate Licensing: Premium Connectors Explained](https://www.epifive.com/blog/power-automate-licensing-premium-connectors) for how licences map to flows.
- The shared mailbox address, not an Office 365 group address. Microsoft states that a group address cannot be used as a shared mailbox address.

## Design the categories first

A classifier is only as good as its label list. Decide the categories before you write a prompt, and keep the list short and mutually exclusive. For example:

| Label | Meaning | Route |
| --- | --- | --- |
| `billing` | Invoices, payments, refunds | Billing team mailbox |
| `access` | Password, account, permissions | Service desk folder |
| `incident` | Something is broken or down | Service desk, flagged |
| `sales` | Quotes and new enquiries | Sales mailbox |
| `other` | Anything else or unclear | Human review |

Always include an `other` label. It gives the model a safe answer when the message does not fit, and it gives your flow a path that does not guess.

## Create the prompt

AI Builder prompts are created in the Power Automate portal:

1. Sign in to Power Automate.
2. Select **AI hub** > **Prompts** > **Build your own prompt**.
3. Name the prompt, for example `Mailbox triage`.
4. Write the instruction, then add an input by typing `/` or selecting **Add content** and choosing **Text**. Give the input a name such as `EmailText`.
5. Enter a sample value for the input and select **Test**.
6. Select **Save** when the result is what you expect.

Microsoft describes a prompt as an instruction plus context, and says a good prompt is clear, specific, contextual and relevant. A prompt for triage might read as follows, with the input placed where the email text belongs:

```text
You classify emails sent to a company support mailbox.
Choose exactly one label from this list: billing, access, incident, sales, other.
Answer with the label only, in lowercase, with no punctuation or explanation.
If the email does not clearly fit one label, answer other.

Email:
[EmailText]
```

In the editor you insert `EmailText` as an input object rather than typing the brackets. Test the prompt with at least one example for every label, including an ambiguous message that should return `other`.

## Build the flow

### Step 1: Add the trigger

1. Select **+ Create** > **Automated cloud flow**.
2. Choose the Office 365 Outlook trigger **When a new email arrives in a shared mailbox (V2)**.
3. Set **Original Mailbox Address** to the shared mailbox address, for example `support@contoso.com`.

The trigger has optional filters that cut cost and noise before the AI step runs:

| Parameter | Use |
| --- | --- |
| Folder | The folder to watch. The trigger only checks the folder you configure |
| From, To, CC, To or CC | Run only when these addresses match |
| Importance | Any, High, Normal or Low |
| Only with Attachments | Skip messages with no attachment when true |
| Include Attachments | Include attachment content in the trigger output |
| Subject Filter | Text to find in the subject line |

Leave **Include Attachments** off unless the prompt needs them, because larger payloads slow the flow.

### Step 2: Run the prompt

1. Add a new step and search for **Run a prompt**.
2. In **Prompt**, choose `Mailbox triage`.
3. In the input field, use dynamic content from the trigger to build the text, for example the subject followed by the body.

Microsoft notes that since May 2025 the action is called **Run a prompt**, replacing the earlier **Create text with GPT using a prompt**. Its output is available as a variable for later steps.

### Step 3: Route with a Switch

Add a **Switch** control on the prompt's text output, with one case for each label and a default case.

| Case | Action |
| --- | --- |
| `billing` | **Send an email from a shared mailbox (V2)** or forward to the billing team |
| `access` | **Move email (V2)** to a service desk folder |
| `incident` | **Flag email (V2)**, then move to an incident folder |
| `sales` | Notify the sales mailbox |
| Default | Start a human review, described below |

The documented parameters for the actions you are likely to use:

- **Move email (V2)** needs **Message Id** and **Folder**, and takes **Original Mailbox Address** for the shared mailbox to move mail from.
- **Send an email from a shared mailbox (V2)** needs **Original Mailbox Address**, **To**, **Subject** and **Body**. Microsoft notes that your account needs permission to access the mailbox, that it works only for Microsoft 365 shared mailboxes, and that it does not work for shared mailboxes converted from personal mailboxes.
- **Reply to email (V3)** needs **Message Id**, and you set **Original Mailbox Address** to reply from the shared mailbox. It does not support encrypted emails.
- **Flag email (V2)** needs **Message Id** and accepts **Original Mailbox Address** and **Flag Status**.

For each action that works on the shared mailbox, set **Original Mailbox Address** explicitly. Otherwise the action may act on the connection account's own mailbox.

## Add human review for uncertain mail

Microsoft documents a pattern for human review of prompt output. After the **Run a prompt** card, add the Approvals action **Start and wait for an approval of text**, set the **Title**, put the prompt's text output in **Suggested Text**, and put an email address in **Assigned To**. Add a **Condition** on **Outcome** that tests for **Approve**, and take the next action only in the true branch. Reviewers see the request under **Approvals** > **Received** in the Power Automate portal, where they can edit the text and confirm.

For triage, the useful variation is to use this only in the default case and for sensitive labels such as `incident`, so the AI handles routine mail and a person sees anything unusual. See [Power Automate Approval Workflow with SharePoint](https://www.epifive.com/blog/power-automate-approval-workflow-sharepoint) for more on approvals.

## Limits and behaviour to know about

Microsoft documents several limits for the Outlook connector and this trigger:

| Limit | Value |
| --- | --- |
| API calls per connection | 300 per 60 seconds |
| Maximum mail content length | 49 MB |
| Concurrent requests | 70 |
| Concurrent megabytes transferred | 300 MB |

Office also enforces per-inbox limits, which you can reach when several flows target the same inbox. Behaviours of the trigger that catch people out:

- It is based on the received date and time. Moving an email does not change that value, so emails received before the last successful run can be skipped.
- It checks only the configured folder, so if a mailbox rule moves mail out of the Inbox, select the correct folder.
- It may intermittently trigger for older emails moved into a folder. Microsoft says this is by design.
- You need a separate flow for each mailbox you want to monitor.
- It does not work for user-to-user shared mailboxes unless one user has full access, not only send permission, to the other mailbox.

## Test and measure

1. Send one test message for each label to the shared mailbox.
2. Open the flow's run history and confirm the prompt output and the branch taken for each.
3. Check what happens for a blank body, a long thread and a message in another language.
4. Keep a spreadsheet or list of a few weeks of messages, the label the flow gave and the label a person would give, and compare them before you let the flow move or reply to mail unattended.

For failure handling around the AI step, see [Power Automate Error Handling with Try-Catch Scopes](https://www.epifive.com/blog/power-automate-error-handling-try-catch), and for general run failures see [Power Automate Flow Failed: Troubleshooting](https://www.epifive.com/blog/power-automate-flow-failed-troubleshooting).

## Troubleshooting

| Symptom | Likely cause | Fix |
| --- | --- | --- |
| Trigger never fires | Wrong folder, a rule moved the mail, or permissions not yet replicated | Select the right folder and wait about two hours after granting access |
| "Specified object was not found in the store" | The message was moved or deleted, or the connection is stale | Delete the Outlook connection and create a new one |
| Action acts on the wrong mailbox | Original Mailbox Address left blank | Set it on every shared mailbox action |
| Run a prompt unavailable | Region limit, licence, or capacity throttling | Check AI Builder availability and credits |
| Output includes extra words | Prompt allows explanations | Tighten the prompt to one lowercase label and add a default case |
| Duplicate processing of old mail | Moved emails can re-trigger by design | Track processed message IDs or categorise on completion |

## Checklist

- Categories fixed, short and mutually exclusive, with an `other` label.
- Prompt tested with an example of every label and an ambiguous message.
- One flow per shared mailbox, with the correct folder and Original Mailbox Address.
- Connection account is a member of the shared mailbox.
- Default branch goes to a person, and Approvals review is in place for sensitive labels.
- AI Builder credits and regional availability confirmed.
- Results compared with human labels before automatic moves or replies.

## References

- Office 365 Outlook connector reference: https://learn.microsoft.com/en-us/connectors/office365/
- Use your prompt in Power Automate: https://learn.microsoft.com/en-us/ai-builder/use-a-custom-prompt-in-flow
- Create a prompt: https://learn.microsoft.com/en-us/microsoft-copilot-studio/create-custom-prompt
- Types of Power Automate licenses: https://learn.microsoft.com/en-us/power-platform/admin/power-automate-licensing/types

## Frequently asked questions

### Which Power Automate trigger watches a shared mailbox?

Use the Office 365 Outlook trigger "When a new email arrives in a shared mailbox (V2)" and put the shared mailbox address in Original Mailbox Address. The account behind the connection must be a member of the shared mailbox, and you need one flow per mailbox.

### What is the action that sends email text to an AI prompt?

The AI Builder action is called Run a prompt. Since May 2025 it replaces the earlier name, Create text with GPT using a prompt. You pick a saved prompt, or create a new one, and fill its inputs with dynamic content from earlier steps.

### Why does my flow say "Specified object was not found in the store"?

Microsoft lists two causes. The mailbox owner may have moved or deleted the message before the flow acted on it, or the connection is stale. Delete the Outlook connection and create a new one to rule out the second cause.

### Should an AI model move emails without anyone checking?

Not at first. Microsoft documents adding a human review step with the Approvals action Start and wait for an approval of text after a prompt. Start with low-risk actions such as applying a folder or label, review the results for a few weeks, and only then widen what the flow does automatically.

