pull the outlook mail that meets a precise condition
get the unread attachment queue without moving a single email. a bot queries an outlook folder for unread mail, attachments, a sender or other properties.
ask for the details and order your report needs. dusk classes this query as a change even though it reads mail. allow the query and folder reads with read and write access, keeping mailbox edits disabled.

what it does
conditions beat a vague search when you need a repeatable list. choose one folder and the properties that matter. the bot can return just the details your report needs. built-in folders like inbox work by name; custom folders need a lookup first.
- the default request covers up to 100 messages
- each batch can hold at most 1,000
- large results need more batches
- if microsoft rejects sorting, the bot sorts the returned mail and tells you
when you would use it
- find unread intake mail with attachments. keep the report inside the named folder.
- read urgent inbox messages. leave them where they are.
- see who sent invoices this month. ask for senders and subjects from that folder.
- clear up who owes the shared team a reply. the connected account must already have access.
try it
paste this into a chat with your bot
every monday and thursday at 14:10, find my custom outlook folder intake. query it for unread messages with attachments. keep fetching until every matching message is included. list sender, subject and received time here, in received-time order. say if you sorted the results yourself. never mark mail read, move messages, open attachments or send replies.- when
- mondays and thursdays at 14:10
- needs
- outlook connected with read and write limited to query emails and folder reads; the account must have access to intake
what comes back looks like this (an example)
intake attachment queue
- saskia, amber finch studio: reference photographs, monday 09:12.
- cedric, river desk: purchase request, monday 10:36.
sorted by time received. mail unchanged.set it up
- connect outlook with read and write. limit the bot to query emails and folder reads.
- name one folder. let the bot find custom folders first.
- try a small query. compare the matches with your folder and read their received times.
- schedule it once the matches look right. open run history in automations to find each report.
what it needs from you
| input | required | what it is |
|---|---|---|
top | no | Maximum number of messages to return per request (1-1000). |
skip | no | Number of messages to skip for pagination. |
filter | no | $51 |
folder | no | SINGLE mail folder to search within (cannot search across all folders). |
select | no | List of message properties to include in the response (accepts comma-separated string or list). |
orderby | no | Sort order as comma-separated string or list (accepts 'field asc/desc' format or JSON-serialized arrays). |
from composio's catalog for Outlook (action OUTLOOK_QUERY_EMAILS, read 12 november 20264). your bot fills these in from what you tell it.
how dusk bot handles it
dusk bot counts Query Emails as a change: it alters something in Outlook, and the sending setting does not cover it. a bot you allow only to read can never call it.
the permissions Outlook asks for to run it: Mail.ReadBasic, Mail.Read, Mail.ReadWrite, Mail.Read.Shared.
where it stops
- one query covers one folder. use separate queries for several locations.
- big folders come back in batches. read all results before calling the list complete.
- ask it to sort the mail it gets. microsoft can reject the requested order as too costly; the bot should tell you and sort locally.
- shared mail still needs access. the bot can't read a mailbox your account cannot open.
try it in 2 minutes
- name a single outlook folder
- allow query emails and folder reads only
- ask for unread messages with attachments
- match the folder, total results and received-time order
mistakes people make
calling the first 100 messages the whole queue
ask it to keep reading until it has every matching result.
granting every mailbox action for a report
allow this query and the folder reads it needs.
before you call the queue complete
- the bot found the intended folder
- the conditions match your question
- all matching results appear
- the received times run in the requested order
questions
why does a mail query need a write grant in dusk?
dusk classifies this action as a change. it still reads mail. allow the query and folder reads specifically, keeping unrelated mailbox edits out.
can it query a folder called supplier returns?
yes. it finds the custom folder first. built-in names such as inbox work directly.
will it always return the newest email first?
no. microsoft can reject the requested order. the query can continue without sorting. ask the bot to say so and sort the returned results itself.
sources
drafted with ai help from the dusk bot docs and the sources listed on this page, then checked against them. if something here is wrong or out of date, write to [email protected].
find the outlook appointment you can only partly remember
an outlook bot for the mail around your meetings
start a new outlook email as a draft
put the next step in your microsoft to do list
decline a specific outlook invitation after your review
retrieve the actual file attached to an outlook email