- Home
- Guides
- AI Builder & AI
- How to organize Outlook emails into folders with AI Builder and Power Automate
How to organize Outlook emails into folders with AI Builder and Power Automate
Build a scheduled flow that runs every night, sends each read email from today to an AI Builder prompt, and moves it into the Outlook folder that matches the category the AI returns.
Jump to a step (8)
Business owners, project managers and admins spend 10 to 30 minutes a day dragging invoices, customer inquiries and project emails into folders. Outlook rules only match keywords, so anything worded differently lands in the wrong place or stays in the inbox.
This is part 2 of the AI email series. In part 1 you built an AI Builder prompt that reads an email's subject, body and sender and returns a category (Invoices, Customer, Projects and so on) as JSON. Here you reuse that prompt in a scheduled flow.
At 11:50 PM each day the flow gets today's read emails from the inbox, runs each one through the prompt and moves it to Inbox/ plus the category name. Because the category names match your folder names exactly, each email lands in the right folder.
What you need
- The AI Builder email classifier prompt from part 1
- AI Builder capacity for the Run a prompt action (not included in Business Basic or Standard alone)
- Outlook folders whose names match the prompt's category names exactly
- Power Automate with the Office 365 Outlook connector
Step by step
0 of 8 done-
01
Create the category folders in Outlook
Create one folder per category. In the video there are seven folders directly under
Inbox. You can also put them outside the inbox or under a parent folder likeAI Organized, as long as you use the matching path later. The folder names must match the category names your prompt returns. This works the same in Outlook on the web and the desktop app. -
02
Create a scheduled cloud flow
In Power Automate select
Create>Scheduled cloud flow. Name itOutlook Email Organizer, keep today as the start date and set it to repeat every1 Day. SelectCreate. -
03
Set the run time on the Recurrence trigger
Open the
Recurrencetrigger. SetTime Zoneto your local time zone,At These Hoursto23andAt These Minutesto50. The flow then runs at 11:50 PM, just before the day ends. You can switch the frequency to weekly if that suits you better. -
04
Get today's read emails
Add
Get emails (V3)from Office 365 Outlook.Folder:Inbox(or any folder you want to organize)Fetch Only Unread Messages:NoInclude Attachments:NoTop:50(raise it if you get more than 50 emails a day)
Under
Advanced parametersaddSearch Queryand enterreceived:today isread:true. This picks only today's emails that you have already read, so nothing moves before you see it. The read filter is optional. -
05
Loop through each email and run the AI prompt
Add
Apply to eachand set its input tobody/valuefromGet emails (V3).Inside the loop add
Run a prompt(AI capabilities) and select your prompt (Microsoft Outlook Email Classifierin the video). Map its three inputs fromGet emails (V3):Subjectto Subject,Bodyto Body andSenderto From. -
06
Move each email to its folder
Still inside the loop, add
Move email (V2)from Office 365 Outlook.Message Id: theMessage IdfromGet emails (V3)(underSee more)Folder: typeInbox/and then insert thecategoryoutput fromRun a prompt
When the AI says
Invoices, the email moves toInbox/Invoices, and so on. -
07
Test the flow
Save, then select
Testand run it manually with Outlook open beside it. Only read emails from today move. Unread emails and older emails stay in the inbox. -
08
Adjust or pause it
Change the prompt to add or remove categories (and create matching folders), or change the search query and schedule. To pause the organizer, turn the flow off, and turn it back on when you are ready.
Tips and common problems
- The category the AI returns must match the folder name exactly. If the prompt says Customer and the folder is Customers, Move email fails.
- If your folders are not under Inbox, change the folder path prefix to match where they are.
- Top is set to 50. If you get more emails than that in a day, increase it or some emails stay unsorted.
- The isread:true filter keeps unread mail in the inbox so you see it first. Remove it if you want everything sorted.
- Run a prompt is an AI Builder action. It uses AI Builder credits, which standard Microsoft 365 Business plans do not include on their own, so check your tenant's capacity before you build.
Start with part 1
This flow reuses the email classifier prompt from Part 1: Create an AI email categorizer. Build that prompt first, then come back to add the folder sorting.
Questions
Can Power Automate move Outlook emails to folders based on AI?
Yes. Run an AI Builder prompt on each email to get a category, then use Move email (V2) with the folder path Inbox/ plus that category.
How do I only move emails I have already read?
In Get emails (V3), set Fetch Only Unread Messages to No and add the search query received:today isread:true.
Does AI Builder come with Microsoft 365 Business Standard?
Not on its own. AI Builder actions such as Run a prompt use AI Builder credits, which come with premium Power Automate licensing or add-on capacity. Outlook, Forms and Excel connectors are standard, but the AI step is not.
