What the agent does
This is for a general contractor building small commercial jobs: a clinic fit-out, a two-storey office, a restaurant shell. Each site's superintendent saves a daily report every working day into OneDrive, in a folder per job under Daily Reports, as a Word file or a PDF exported from a phone app. The project managers read them, but on Friday they need the week in one page per job for the Monday owner meeting: what was done, what held the job up, who was on site, what was inspected or delivered, and which days have no report at all. The agent reads the folder and writes that page. Connect OneDrive once with the API key: POST /me/connections {"type": "app", "name": "onedrive"} answers with an authorize_url, which the key's creator opens while signed in to the Rush console, using the Microsoft account that owns the Daily Reports folder.
The agent reads files through Microsoft Graph, which Rush signs as that account. It lists the Daily Reports folder by its path, then each job folder's children with GET /me/drive/items/{item-id}/children, following @odata.nextLink when a folder holds more than one page of 200 items. It keeps files whose lastModifiedDateTime or whose date in the file name falls between Monday and Friday, and downloads each with GET /me/drive/items/{item-id}/content into its sandbox, where it reads the Word and PDF files.
From each report it takes the date, the superintendent, the weather and any time lost to it, the trades and headcount on site, work completed, inspections called and their result, deliveries, visitors, and anything written under delays, issues or safety. It then writes one section per job: a five-line summary of the week, a table of each day with crews and hours lost, the inspections and deliveries, open issues carried from earlier reports, and the working days with no report filed.
The page comes back as the run's answer, in Markdown, so the project manager edits it before the owner sees it. The prompt forbids writing to OneDrive: Rush's OneDrive sign-in carries Files.ReadWrite.All, which could change the superintendents' files, and those reports are the job's record.
Start it with one API call
POST https://api.phoenix.so/o/{org}/sessions with this body:
{
"agent": "claude",
"input": "Weekly site report summary for 2026-11-16 to 2026-11-20. Use OneDrive. List the folder 'Daily Reports' and each job folder in it; follow @odata.nextLink. For each job, take report files dated that week (by file name date, else lastModifiedDateTime), download each with /me/drive/items/{item-id}/content and read it. Extract per day: superintendent, weather and hours lost, trades and headcount, work completed, inspections and result, deliveries, delays or issues, safety notes. Answer in Markdown with one section per job: 5-line summary; a day table (date, headcount, hours lost, notes); inspections; deliveries; open issues; working days with no report. Do not upload, edit, move, rename or delete anything in OneDrive.",
"connections": [
"onedrive"
]
}- 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.
- Send the request. POST the body in request.json to https://api.phoenix.so/o/{org}/sessions. The run starts in its own cloud sandbox.
- 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 answer is a Markdown document with one section per job. Each section starts with the week in five lines, then a row per working day with the headcount, hours lost and a note, then the inspections and their results, the deliveries, issues still open at the end of the week, and the days with no report. It arrives as result on GET /o/{org}/sessions/{id}, and, on a run the company's own system started with an API key, in that key's run.completed webhook when it fits in 16 KiB.
The project manager reads each section against the superintendent's own reports for anything that will reach the owner: a failed inspection, a delay blamed on another trade, a safety note. The agent copies what the reports say and does not judge cause or responsibility, so wording that assigns fault is the project manager's to write or leave out. A day listed as missing may be a report saved in the wrong folder, which the superintendent can confirm.
Run it on every Friday afternoon
Save the prompt as an agent with POST /o/{org}/agents and connections: ["onedrive"], and give it an automation in the console with a schedule trigger, a cron such as 0 15 * * 5 and the company's timezone; a schedule fills nothing into the prompt, so the saved prompt says "this Monday to Friday" in place of the dates. Automations need Pro or Max. A company that schedules from its own system sends the request each Friday with the dates filled in and a request_id that is a UUID v5 of the week's end date.
When the week's summary is needed early, for a meeting called on Thursday, run the same request with the shorter date range and the page covers the days filed so far.
The use case this job follows, with its automation and trigger: Produce a report or file, no repo.
Why run it on Rush?
The reports are documents written by people on site, each a little different, and the summary needs reading, not parsing. A script would need a Microsoft app registration, stored tokens and a document parser per format. On Rush the OneDrive sign-in stays in Rush's connection, Rush signs the Graph calls outside the sandbox, and the agent reads the files the way the project manager would.
Every Friday's summary is a session with its record: which files were found in each folder, which were opened, and what was taken from each. When an owner disputes a delay months later, the session shows which daily reports the summary came from, and each run's cost is on the session.
Frequently asked questions
Our superintendents use a field app, not Word files. Does this work?
It works when the app saves or exports each day's report to OneDrive, as a PDF or a document. If the app keeps reports only in its own system, the agent cannot read them through OneDrive, and the page's request would need the app's own connection instead.
Can it save the summary into the job folder?
The sign-in could, because Rush's OneDrive connection has Files.ReadWrite.All, but this prompt forbids writing so the job's record stays as the superintendents left it. The summary comes back as the run's answer, and the project manager saves the edited version where the company keeps owner reports.
What about a folder shared from someone else's OneDrive?
The agent reads the drive of the account that connected. Put the Daily Reports folder in that account's OneDrive, or connect the account that owns it, so the paths in the prompt resolve.
How many jobs can one run cover?
One run reads every job folder under Daily Reports. A company with many active jobs can also start one run per job folder, which run side by side, each answering with its own section.