apply one gmail filing decision to a batch of messages
clear the delivery notices without losing the customer replies beside them. the bot finds individual gmail messages and adds or removes labels.
that can archive mail or mark it read. one request covers up to 1,000 messages. filing skips sending approval, so tell it to show the matches and ask before changing them.

what it does
turn a pile of delivery notices into a clear inbox. removing inbox archives a message. removing unread marks it read. work on individual messages, so a customer reply in the same conversation stays put.
the bot searches first and looks up custom labels by name. gmail's success response means it accepted the request. have the bot read back the saved labels to see which changes stuck.
when you would use it
- archive delivery notices after the parcels arrive
- mark a chosen group of newsletters read
- label workshop registrations from one named sender
- remove an old project label from emails you have reviewed
try it
paste this into a chat with your bot
on the second wednesday of each month at 4, find last month's delivery notices from heron parcel notices in work gmail. show every sender, subject and date here. ask me before you change anything. after i agree, remove only the inbox label from those messages. read back their labels and report any failures. never delete mail or include customer-written messages.- when
- second wednesday of the month at 16:00
- needs
- work gmail; read and write for message search and label changes
what comes back looks like this (an example)
archive proposal
- heron parcel notices, 3 october: delivered to studio
- heron parcel notices, 9 october: delivery window updated
remove inbox from these messages?set it up
- connect work gmail. allow the search and label actions with read and write.
- try a small group first. ask for the matching messages without any changes.
- name the exact label to add or remove. keep the preview-and-agree step in the routine.
- inspect the labels after it finishes. Pause stops future runs if the search catches too much.
what it needs from you
| input | required | what it is |
|---|---|---|
messageIds | yes | List of message IDs to modify. |
userId | no | User's email address or 'me' for the authenticated user. |
addLabelIds | no | List of label IDs to add to the messages. |
removeLabelIds | no | List of label IDs to remove from the messages. |
from composio's catalog for Gmail (action GMAIL_BATCH_MODIFY_MESSAGES, read 12 november 20264). your bot fills these in from what you tell it.
how dusk bot handles it
dusk bot counts Batch modify Gmail messages as a change: it alters something in Gmail, and the sending setting does not cover it. a bot you allow only to read can never call it.
the permissions Gmail asks for to run it: https://mail.google.com/, gmail.modify.
where it stops
- file up to 1,000 messages in one request. split larger approved groups and keep the message list for each.
- look up custom labels before filing. an unmatched label name can leave mail unchanged without a clear failure.
- read back the labels to see what stuck. an accepted request can still leave individual messages unchanged.
try it in 2 minutes
- connect gmail and allow search plus label changes
- ask for five newsletter matches, without changing them
- read the list, then ask it to mark only those messages read
- ask it to read back their saved labels
quick checklist
- the account and date window match the job
- every selected message belongs in this group
- the requested change names the label to add or remove
- the saved labels show the filing worked
mistakes people make
filing whole conversations from one matching message
review individual messages. a customer reply can share a thread with a notice.
trusting the word success
have the bot inspect the labels after the batch.
questions
does archiving delete the emails?
no. archiving removes the inbox label. it leaves the email in gmail.
can it mark a group of messages unread?
yes. it adds unread to the messages you choose.
will it ask me before it files anything?
tell it to ask before filing. sending settings do not cover labels. read only blocks filing entirely.
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 gmail messages from a half-remembered detail
a gmail assistant that sorts, drafts and briefs you
claude code for email: clean up one slice first
draft gmail replies with ai, then send them yourself
permanently delete one gmail conversation with ai
get the gmail attachment you actually need