AI & automation

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.

By EpiFive Editorial TeamReviewed/updated 10 min readHow we check articles
On this page

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 [email protected] 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 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:

LabelMeaningRoute
billingInvoices, payments, refundsBilling team mailbox
accessPassword, account, permissionsService desk folder
incidentSomething is broken or downService desk, flagged
salesQuotes and new enquiriesSales mailbox
otherAnything else or unclearHuman 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:

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 [email protected].

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

ParameterUse
FolderThe folder to watch. The trigger only checks the folder you configure
From, To, CC, To or CCRun only when these addresses match
ImportanceAny, High, Normal or Low
Only with AttachmentsSkip messages with no attachment when true
Include AttachmentsInclude attachment content in the trigger output
Subject FilterText 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.

CaseAction
billingSend an email from a shared mailbox (V2) or forward to the billing team
accessMove email (V2) to a service desk folder
incidentFlag email (V2), then move to an incident folder
salesNotify the sales mailbox
DefaultStart 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 for more on approvals.

Limits and behaviour to know about

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

LimitValue
API calls per connection300 per 60 seconds
Maximum mail content length49 MB
Concurrent requests70
Concurrent megabytes transferred300 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, and for general run failures see Power Automate Flow Failed: Troubleshooting.

Troubleshooting

SymptomLikely causeFix
Trigger never firesWrong folder, a rule moved the mail, or permissions not yet replicatedSelect 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 staleDelete the Outlook connection and create a new one
Action acts on the wrong mailboxOriginal Mailbox Address left blankSet it on every shared mailbox action
Run a prompt unavailableRegion limit, licence, or capacity throttlingCheck AI Builder availability and credits
Output includes extra wordsPrompt allows explanationsTighten the prompt to one lowercase label and add a default case
Duplicate processing of old mailMoved emails can re-trigger by designTrack 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

Questions people ask

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.

Power AutomateAI BuilderExchange OnlineOutlookShared mailbox
  1. Automate Overdue Invoice Reminder Emails with Power Automate

    Build a scheduled Power Automate flow that reads an Excel table of invoices, finds overdue unpaid ones, emails reminders through Outlook and logs each reminder to avoid duplicates.

    AI & automation12 min read
  2. Power Automate Run a Prompt Action: Classify and Summarise Text in Flows

    Create a prompt in prompt builder, call it from a Power Automate cloud flow with the Run a prompt action, add human review, and understand credits and common errors.

    AI & automation10 min read
  3. AI Builder Document Processing in Power Automate: Setup and Costs

    Set up AI Builder document processing in a Power Automate cloud flow, learn the credit and Copilot Credit cost per page, and plan for the November 2026 licensing changes.

    AI & automation10 min read
  4. Power Automate Scheduled Flow: Send a Daily Report Email from Excel

    Build a scheduled cloud flow that reads rows from an Excel table, formats them as an HTML table and emails the report every weekday morning.

    AI & automation8 min read
  5. Save Outlook Email Attachments to SharePoint with Power Automate

    Build a cloud flow that saves every Outlook attachment to a SharePoint library, skips signature images, and handles size limits and duplicate runs.

    AI & automation7 min read
  6. Power Automate: Send Email From a Shared Mailbox and Attach Files

    Build a Power Automate flow that sends email from a shared mailbox with one or more SharePoint files attached, to several recipients, with the right Send As permission.

    Microsoft 36513 min read