1. Home
  2. Guides
  3. AI Builder & AI
  4. How to categorize Outlook emails with AI Builder and Power Automate
AI Builder & AI

How to categorize Outlook emails with AI Builder and Power Automate

Create an AI Builder prompt that reads each new email's subject, body and sender and picks one business category, then use Power Automate to apply that category in Outlook automatically.

  • By Nur Islam
  • 10:24 video
  • 11 steps
  • 16K views
Jump to a step (11)
Who this is for

Business owners and finance or project teams spend time every morning working out which emails are invoices, orders, customer questions or project updates. Outlook rules only match fixed senders or keywords, so they break when the same sender sends different kinds of email.

The build has two parts. First, a custom prompt in AI Builder acts as an email classifier: it takes the subject, body and sender as inputs and returns exactly one category, such as Invoices, Customer or Projects. Second, a Power Automate flow runs on every new email, passes it to the prompt with Run a prompt, and uses Assign an Outlook category to tag the email with the result.

Once emails are tagged, you can select a category in Outlook or search for it to see just those emails.

What you need

  • Microsoft 365 with Outlook and Power Automate
  • Access to AI Builder prompts (AI Builder credits or a trial in your environment)
  • Outlook categories that match the names in your prompt
  • A list of the categories you want, for example Invoices, Orders, Legal, Admin, Customer, Projects and Other

Step by step

0 of 11 done
  1. 01

    Start a custom prompt in AI Builder

    In Power Automate, go to AI hub and select Build your own prompt. This prompt will read each email and decide its category.

  2. 02

    Write the classifier instructions

    In the instructions, tell the AI what its job is and define the categories. The video's prompt:

    • Says it is an email classification system that puts each business email into exactly one category
    • Defines seven categories: Invoices (bills and payments), Orders (purchase orders and vendor matters), Legal (contracts and compliance), Admin (HR and IT notifications), Customer (external client emails), Projects (internal teamwork) and Other (everything else, like newsletters)
    • Explains how to decide: read the subject first, then the body, then check the sender. For example, an invoice number points to Invoices, and a customer sender points to Customer.
    • Gives short examples such as "Invoice payment due" = Invoices and "Project status update" = Projects
    • Ends with: respond with only the category name, no explanation
  3. 03

    Add the subject, body and sender inputs

    Replace each placeholder in the instructions with an input. Delete the placeholder, select Add content > Text, and name the input. Create three text inputs: Subject, Body and Sender. Clear names make them easy to find in the flow.

  4. 04

    Choose the model and JSON output

    Leave the model on the default GPT-4.1 mini. It handles text-only classification well. Under the model response settings, change the output to JSON so the flow receives a structured category value it can use directly.

  5. 05

    Test and save the prompt

    Enter a sample subject and body (you can leave the sender blank) and select Test. Check the category it returns, then try a second sample, such as a customer inquiry, to confirm it picks Customer.

    Name the prompt Microsoft Outlook Email Classifier and save it.

  6. 06

    Create colored categories in Outlook

    In Outlook on the web, right-click any email and choose Categorize > Manage categories. Edit the existing categories or create new ones so you have one for each category in your prompt, each with a color.

    Use the exact same names as in the AI Builder instructions. If they do not match, Power Automate creates new grey categories instead of using yours. You can also do this in the Outlook desktop app.

  7. 07

    Create the flow

    In Power Automate, select Create > Automated cloud flow, name it Microsoft Outlook Email Classifier, and choose the trigger When a new email arrives (V3) from Office 365 Outlook.

  8. 08

    Run the prompt on each email

    Add Run a prompt (under AI capabilities, or search for it). Select your Microsoft Outlook Email Classifier prompt and fill the three inputs from the trigger:

    • Subject: Subject
    • Body: Body
    • Sender: From

    If you cannot see a field, select See more under the trigger's outputs.

  9. 09

    Assign the category in Outlook

    Add Assign an Outlook category. Set Message Id to the trigger's Message Id (under See more) and Category to the category output from Run a prompt. Save the flow.

  10. 10

    Test with real emails

    Select Test > Manually > Test and send yourself an email that looks like an invoice. When the run finishes, the email in Outlook shows the Invoices category. Send several different emails and check that each gets the right category.

  11. 11

    Filter by category and pause when needed

    Select a category name in Outlook to see all emails in it, or type the category name in the search box and select it.

    To stop categorizing for a while, turn off the flow in Power Automate. Turn it back on when you are ready.

Tips and common problems

  • Outlook category names must match the category names in the prompt exactly, or Power Automate creates new grey categories.
  • Tell the prompt to answer with only the category name. Extra words would become the category name.
  • If Run a prompt is not listed under AI capabilities, search for it by name.
  • Turn the flow off to pause categorization. It only works on new emails that arrive while it is on.
Still stuck? Ask AI to help you fix itChatGPTClaudeGeminiCopilotPerplexityGrok

Categories used in the video

CategoryWhat goes there
InvoicesBills and payments
OrdersPurchase orders and vendor matters
LegalContracts and compliance
AdminHR and IT notifications
CustomerExternal client emails
ProjectsInternal teamwork
OtherEverything else, like newsletters

Want folders instead of categories? The same prompt can sort email into folders: Organize Outlook Emails into Folders with Power Automate.

Questions

Can Outlook categorize emails automatically using AI?

Outlook rules cannot read email content the way AI can. With an AI Builder prompt and a Power Automate flow, each new email is classified from its subject, body and sender, and the flow applies the matching Outlook category.

Do I need a premium licence for AI Builder in Power Automate?

AI Builder is a premium capability that uses AI Builder credits. Many environments can start with a trial, but for ongoing use you need a licence or capacity that includes AI Builder credits. The Outlook trigger and category action themselves are standard.

Why is Power Automate creating new grey categories?

The category text from the prompt does not exactly match an existing Outlook category name. Make the names in your prompt and in Outlook identical.

Can I move emails into folders instead of categorizing them?

Yes. The same prompt can drive a different flow that moves each email into a folder based on its category. That is covered in the follow-up video.

Video chapters
Ask a question in the comments Last checked 26 Sep 2026. Screens change: if a step looks different, tell me in the comments.