Archive Gmail Messages
2
Confirm what user wants to archive. Options:
- Specific messages from a prior search (use message IDs)
- Messages matching a search query (run search first)
If archiving by query, run
Search Gmail first to find messages,
then show the user what will be archived and get confirmation.
ALWAYS confirm before archiving: "Archive these X messages? [list subjects or senders]"
3
Once confirmed, collect the message IDs and run the archive code.
Pass comma-separated message IDs.
5
Check the results. Report success or failure.
If successful: "Done. Archived X messages—they're still in All Mail if you need them."
If failed: "Some messages couldn't be archived. [details]"
You MUST use a todo list to complete these steps in order. Never move on to one step if you haven't completed the previous step. If you have multiple read steps in a row, read them all at once (in parallel).
Add all steps to your todo list now and begin executing.
## Steps
1. [Read Gmail Search Operators]: Read the documentation in: `./skills/sauna/[skill_id]/resources/context/gmail.inbox.search.md` (Reference Gmail search operators)
2. Confirm what user wants to archive. Options:
- Specific messages from a prior search (use message IDs)
- Messages matching a search query (run search first)
If archiving by query, run `./skills/sauna/[skill_id]/resources/recipes/gmail.inbox.search.md` first to find messages,
then show the user what will be archived and get confirmation.
ALWAYS confirm before archiving: "Archive these X messages? [list subjects or senders]"
3. Once confirmed, collect the message IDs and run the archive code.
Pass comma-separated message IDs.
4. [Gather Arguments: Archive Gmail Messages] The next step has the following requirements for arguments, do not proceed until you have all the required information:
- `messageIds`: {{messageIds}}
- `outputPath` (default: "session/archive-results.json"): ./session/archive-results.json
5. [Run Code: Archive Gmail Messages]: Call `run_script` with:
```json
{
"file": {
"path": https://sk.ills.app/code/gmail.inbox.archive/preview,
"args": [
"messageIds",
"outputPath"
]
},
"packages": null
}
```
6. Check the results. Report success or failure.
If successful: "Done. Archived X messages—they're still in All Mail if you need them."
If failed: "Some messages couldn't be archived. [details]"