# Which Clients Still Owe Us Documents? An Accounting Firm's Weekly Check of Client Folders in OneDrive

An accounting firm's agent compares each client's OneDrive folder with the firm's checklist every Monday and lists the documents each client still owes.

[Run this on Rush](https://cloud.getrush.ai/run/list-missing-client-documents/onedrive/). Opens the console with this prompt ready to send. Connect OneDrive there first.

## What the agent does

This is for a small accounting firm that prepares year-end accounts and returns for a few hundred clients: sole traders, partnerships and small companies. From January the firm waits on documents: bank statements, payroll summaries, invoices for large purchases, loan statements. Clients upload them to a OneDrive folder the firm shares with each of them, Clients/<client>/2026 Year-end, and the partners spend most of a morning each week opening folders to see who is still short. The agent does that check across every client and writes the chase list.

The firm connects OneDrive once with `POST /me/connections {"type": "app", "name": "onedrive"}`, signed in as the account that owns the Clients folder. Rush asks Microsoft for `Files.ReadWrite.All`, the scope its OneDrive product names, and the prompt keeps the agent to reading. A run lists client folders with `GET /me/drive/root:/Clients:/children`, then each client's year-end folder with `GET /me/drive/root:/Clients/{client}/2026 Year-end:/children`, selecting `name`, `size`, `lastModifiedDateTime` and `file`. Microsoft's reference says a folder past the default page of 200 items returns `@odata.nextLink`, which the run follows.

Each client's folder also holds `checklist.txt`, one requested document per line, written when the engagement letter went out. The agent reads it through the item's `/content` path and matches each line to the files present: by name first, so Bank statements Jan to Dec is checked against files named for the months, and by opening a PDF or spreadsheet only when its name says nothing, such as scan_0042.pdf. A partial match, nine bank statements of twelve, is listed as partial with the missing months named.

It writes one line per client with each item received, partial or missing and the date of the newest upload, then drafts a short chase email for every client still missing something, listing exactly what is outstanding. It moves, renames, deletes and shares nothing, writes nothing into client folders, and sends nothing. Whether a client needs a document at all is the firm's judgment, written in the checklist; the agent reports against it.

## Start it with one API call

`POST https://api.phoenix.so/o/{org}/sessions`

```json
{
  "agent": "claude",
  "input": "Check which year-end documents our clients still owe, as of 2026-11-16. Use OneDrive through Microsoft Graph. Call GET /me/drive/root:/Clients:/children for the client folders. For each client, call GET /me/drive/root:/Clients/{client}/2026 Year-end:/children with $select name,size,lastModifiedDateTime,file, following @odata.nextLink, and read checklist.txt in that folder (one required document per line). Match each checklist line to files by name; open a PDF or spreadsheet only when its name does not say what it is, and mark matches made that way. Mark each line received, partial (say what part is missing, such as which months) or missing. A folder with no checklist.txt goes under No checklist. Write chase-list.md (clients with anything missing first, then complete clients; for each: outstanding items and the newest upload date) and chase-list.csv (client, item, status, note). For each client with missing or partial items, draft a chase email under 120 words listing them, signed by the firm. Read only: do not upload, move, rename, delete or share anything.",
  "connections": [
    "onedrive"
  ]
}
```

1. **Get an API key.** In the console, open Settings, then API keys, and create a key for your org. Send it in the Authorization header as a Bearer token.
2. **Send the request.** POST the body in request.json to https://api.phoenix.so/o/{org}/sessions, with your repository as the resources URL. The run starts in its own cloud sandbox.
3. **Read what came back.** Follow the run on its live stream or wait for the run.completed webhook, then read the result and its trajectory.

## What comes back

The session returns `chase-list.md` and `chase-list.csv` as artifacts, with the drafted emails under each client in the Markdown. The answer says how many clients are complete and how many still owe something.

What the partner checks: matches the agent made by opening a file, which it marks so they can be confirmed; documents a client sent by email or post, which are not in the folder and so show as missing; and each draft before it goes out from the firm's own mail. The checklist is the firm's, and the agent decides nothing about what a client must provide.

## Run it on every Monday morning in the busy season

The office manager saves the agent with `POST /o/{org}/agents`, naming the `onedrive` connection, with the folder layout and the matching rules as its instructions, and adds a console automation with a `schedule` trigger (`0 7 * * 1`, `timezone` set to the firm's) that runs it. A schedule runs the saved prompt as written, so the saved prompt says as of today, and the manager turns the automation off when the season ends and on again in January.

In the last weeks of the season the manager can add a Thursday trigger, so the chase list is fresh twice a week.

## Why run it on Rush?

The firm's Microsoft sign-in stays in Rush's connection rather than in a script with a stored password, and the transcript lists every folder and file the agent opened, which matters when the files are clients' bank statements. The run reads only the paths the prompt names in the connected account's drive.

Each Monday is its own session with its own computer and a record of what its model calls cost, so the firm can see what the weekly check costs across the season. The checklist lives in each client's folder, so when a partner adds a document to one client's request, the next run checks for it with no change to the agent.

## Frequently asked questions

### Does the agent open every client file?

No. It matches by file name first and opens a file only when its name says nothing about what it is. The transcript lists each file it opened, and the chase list marks every match made that way.

### Why does Rush ask for write access to OneDrive?

Rush's OneDrive sign-in asks for `Files.ReadWrite.All`, the scope its OneDrive product names, so one connection serves jobs that save files too. Microsoft's reference lists `Files.Read` as enough to list a folder; this agent's prompt forbids uploading, moving, renaming, deleting and sharing.

### Can it send the chase emails?

This job connects OneDrive only, so it drafts each email in the chase list. A person sends each one from the firm's mail after checking it against anything the client has said by phone.

### Our client folders live in a SharePoint library. Does this still work?

This prompt reads the connected account's own OneDrive by path. Microsoft's reference lists the same children call on any drive by id, `/drives/{drive-id}/items/{item-id}/children`, so the prompt can name a shared library's drive instead; try it on one client's folder first.

## More OneDrive jobs

- [Which Supplier Prices Went Up This Month? A Field-Service App's Check of Each HVAC Contractor's OneDrive Price Lists](https://getrush.ai/run/compare-supplier-price-lists/onedrive/)
- [Read Supplier Invoice PDFs From Each Customer's OneDrive Into Draft Bills](https://getrush.ai/run/extract-supplier-invoices/onedrive/)
- [Flag Subcontractors' Expiring Insurance Certificates in Each Contractor's OneDrive](https://getrush.ai/run/flag-expiring-insurance-certificates/onedrive/)

## More jobs like this: Produce a report or file, no repo

- [What Changed in Our n8n Automations This Week? An Accounting Firm's Friday Change Log](https://getrush.ai/run/log-weekly-n8n-workflow-changes/n8n/)
- [Turn Notion Meeting Notes Into Action Items](https://getrush.ai/run/meeting-action-items/notion/)
- [Report Stale GitLab Merge Requests](https://getrush.ai/run/merge-request-report/gitlab/)

## Keep reading

- [Connect OneDrive to Rush once, then name it on any run](https://getrush.ai/integrations/onedrive/)
- [Start your first run from the developer API quickstart](https://getrush.ai/docs/quickstart/)
- [Rush pricing: Free, Pro and Max](https://getrush.ai/pricing/)
