What the agent does
This is for a company that sells scheduling and billing software to tutoring centres: a maths and English centre with forty tutors, a test-prep business, a music school that teaches theory online. The software knows every session that happened, who taught whom and when. What it does not hold is the session notes, because most centres had their tutors write those as Google Docs long before they bought the software: one folder per student in a shared Drive folder, one doc per session, named with the date. Parents are promised a note after every session, and directors only find the gaps when a parent asks why there has been nothing for three weeks. The software adds a Friday report that matches the week's sessions to the notes in Drive and lists what is missing.
The company connects a Google account of its own, saves the agent once as a template with POST /o/{org}/agents naming google-drive in connections, with instructions that allow reading only, and keeps its id. When a centre turns the report on, the backend calls POST /o/{org}/agents {"template": "<template id>", "name": "notes-check-<centre id>"}, then POST /o/{org}/agents/{agent}/connections {"type": "app", "name": "google-drive"}, and opens the authorize_url in a popup while the centre's director is signed in to the software. The director signs in on Google's page with the account that can see the student folders, and picks the parent folder in the software's settings. The Drive sign-in reads files, can edit any spreadsheet the director can open and the files Rush itself created, so the template forbids every write.
Each Friday the software's backend puts the week's sessions in the prompt: student, tutor, date and time, and the id of the student's Drive folder. The agent calls Drive's files.list once per student folder with a q of '<folder id>' in parents and mimeType = 'application/vnd.google-apps.document' and trashed = false and modifiedTime > '<Monday>', asking with fields for nextPageToken, files(id, name, createdTime, modifiedTime, lastModifyingUser, webViewLink) and passing nextPageToken back as pageToken until there is none. It matches each session to a doc whose name or opening line carries the session's date.
A match is not the end of it, because a doc copied from the template and never filled in looks the same in a file list. For each matched doc the agent calls files.export with mimeType text/plain and checks the text: more than the template's headings, at least 40 words of the tutor's own. It also notes a note created more than 48 hours after the session. It returns no note text, only whether each session has a note, an empty template or nothing, so a report about missing notes does not become a copy of children's progress notes.
Start it with one API call
POST https://api.phoenix.so/o/{org}/sessions with this body:
{
"agent": "<agent id>",
"input": "Weekly session notes check for this centre. Week: Monday 2026-11-16 to Sunday 2026-11-22, time zone America/Los_Angeles. Template headings that do not count as content: 'What we covered', 'How it went', 'Homework', 'Next session'. Sessions (student | student folder id | tutor | start): Maya R. | 1aB3cD4eF5gH6iJ7kL8mN9oP0qR | Daniel K. | 2026-11-17 16:00; Maya R. | 1aB3cD4eF5gH6iJ7kL8mN9oP0qR | Daniel K. | 2026-11-19 16:00; Theo W. | 1zY2xW3vU4tS5rQ6pO7nM8lK9jI | Priya S. | 2026-11-18 17:30. Read only. 1) For each student folder, files.list with q \"'<folder id>' in parents and mimeType = 'application/vnd.google-apps.document' and trashed = false and modifiedTime > '2026-11-16T00:00:00'\", fields nextPageToken, files(id, name, createdTime, modifiedTime, lastModifyingUser, webViewLink); follow nextPageToken. 2) Match each session to a doc whose name or first line has the session date (any common date format). 3) files.export each matched doc as text/plain; status 'written' if it has 40 or more words outside the template headings, else 'empty template'. Late if createdTime is more than 48 hours after the session start. 4) Return JSON only: {week, sessions: [{student, tutor, start, status: written | empty template | missing, late, doc_url}], by_tutor: [{tutor, sessions, missing, empty_template, late}]}. Never include any text from a note. Do not create, edit, move, share or delete any file or spreadsheet."
}- 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
What comes back is the JSON in the session's result, which reaches the software's server on its webhook: every session of the week with a note that is written, an empty template or missing, whether it came late, a link to the doc, and a count per tutor. The software shows the director the missing and empty ones first, grouped by tutor, so the Friday follow-up is one message per tutor rather than one per session.
What the director checks before chasing anyone: a session marked missing whose note was filed in the wrong student's folder or named without a date, which the link to the student's folder makes quick to spot; and a session that was cancelled in person but never in the software. Reminding a tutor stays with the director, and the agent never writes to the tutor or the parent.
Run it on every Friday evening
The software's scheduler sends POST /o/{org}/sessions with {"agent": "<agent id>", "input": "…"} for each centre at 18:00 on Friday in the centre's time zone, building the session list from its own schedule and adding a request_id made as a UUID v5 of the centre id and week, so a retry never starts a second run.
A centre that sends notes to parents daily can instead have the backend start the same agent each evening with that day's sessions only; the agent and its instructions do not change, only the list in the prompt.
The use case this job follows, with its automation and trigger: Run an agent per customer task.
Why run it on Rush?
Each centre's Google sign-in is held in Rush's connection under that centre's own agent, so one centre's run never sees another centre's student folders, and the software stores agent ids rather than Google tokens. When a centre leaves, deleting its agent disconnects its Google account.
Each run has its own computer and a record of every file it listed and exported, so when a tutor says a note was there, the director's support team can see what Drive returned that Friday. The software lists each centre's runs with GET /o/{org}/sessions?agent=<agent id> and adds up total_cost_usd to price the report.
Frequently asked questions
Why does the backend send the sessions instead of the agent reading a timetable?
The software already knows exactly which sessions happened, including cancellations and swaps. Putting that list in the prompt means the agent checks notes against the truth, not against a spreadsheet someone may not have updated.
Does the agent read what tutors wrote about each child?
It exports each matched doc to check that it is more than an empty template, and the instructions forbid returning any of its text. The result says only whether a note exists, is empty or is missing.
What if a note is very long?
Google's docs say an export is limited to 10 MB, far beyond any session note. A doc that cannot be exported is reported with its link so the director can open it.
Can tutors' notes live in a shared drive?
The agent sees what the director's Google account can see. If the student folders are in a shared drive the director belongs to, give the agent those folder ids; if it cannot list one, that folder is reported rather than guessed at.
More Google Drive jobs
More jobs like this: Run an agent per customer task
- Which Customer Payments Never Got Applied to an Invoice? A Month-End Close App's Check of Each Client's QuickBooks (QuickBooks)
- Flag Subcontractors' Expiring Insurance Certificates in Each Contractor's OneDrive (OneDrive)
- Flag Products in Each Online Store's Airtable Catalog That Are Not Ready to List (Airtable)