What the agent does
This is for a software company that sells estimating software to general contractors who bid on commercial building work: schools, clinics, warehouse fit-outs. On every project an estimator invites subcontractors from each trade (concrete, steel, roofing, electrical, plumbing) to bid, and the bids arrive in the estimator's Outlook as PDFs over the last two days, many in the final hour. Before the general contractor's own bid goes in, the estimator has to know, trade by trade, who bid, for how much, what they left out and whether they saw the latest addendum. The software's new feature drafts that comparison from the estimator's own mailbox.
The company saves the agent once as a template with POST /o/{org}/agents and "connections": [{"name": "outlook", "access": "read"}], after connecting an Outlook account of its own. When an estimator turns the feature on, the backend makes their agent with {"template": "<template id>", "name": "bids-<estimator id>"}, calls POST /o/{org}/agents/{agent}/connections {"type": "app", "name": "outlook"}, and opens the authorize_url in a popup, where the estimator signs in to Microsoft. At the read level the consent asks for Mail.Read and Contacts.Read only, never for sending, and the template's instructions forbid replying to or forwarding any message.
On a run the agent searches the mailbox with Microsoft Graph's GET /me/messages and a $search built from the project's name and number in the subject and hasAttachments:true, selecting subject, from, receivedDateTime and hasAttachments. Microsoft's docs say a message search returns up to 1,000 results sorted by when each was sent, which is plenty for one project. For each message it lists the attachments with GET /me/messages/{id}/attachments and reads each PDF's text: the trade, the base bid, alternates, the addenda the bidder acknowledged, the stated exclusions and how long the price holds.
It builds one table per trade from the trade list the app sends, with every bidder beside the others, and marks the low bid. A bid that does not acknowledge the latest addendum is flagged rather than dropped, and a trade with fewer than two bids is listed as thin coverage so the estimator can call another sub while there is still time. The draft never goes anywhere by itself: it appears in the estimating app, and the estimator decides which number to carry.
Start it with one API call
POST https://api.phoenix.so/o/{org}/sessions with this body:
{
"agent": "<agent id>",
"input": "Draft the subcontractor bid comparison for project 2611 Riverside Library Renovation, bids due 2026-11-18 14:00 Central. Latest addendum: Addendum 3. Trades: 03 Concrete, 05 Steel, 07 Roofing, 09 Finishes, 22 Plumbing, 23 HVAC, 26 Electrical. Search my Outlook with GET /me/messages and $search=\"subject:2611 AND hasAttachments:true\", then again with \"subject:Riverside AND hasAttachments:true\", $select subject,from,receivedDateTime,hasAttachments, following @odata.nextLink. Keep messages received since 2026-11-01. For each, GET /me/messages/{id}/attachments and read every PDF. Return only JSON {trades: [{trade, bids: [{bidder, email, received, base_bid, alternates: [{name, amount}], addenda_acknowledged: [], exclusions: [], valid_days, low: true|false}], coverage: ok|thin}], unmatched: [{from, subject, received, reason}], unreadable: [{from, attachment}]}. Flag any bid that does not acknowledge Addendum 3. Read only: do not reply, forward, move or flag any message."
}- 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 run builds a bid-leveling table for each trade, with a column per bidder, the low bid marked and the exclusions under each number. The session's answer is the JSON, which the app's webhook handler loads into the project's bid-leveling screen with a red mark on any bid that missed the latest addendum. Messages the agent could not place in a trade and attachments it could not read are listed above the tables, since a bid hiding in that list is a bid the estimator would otherwise miss.
What the estimator checks before carrying a number: that the low bid's exclusions do not leave a gap another trade has to cover, that a bid flagged for the addendum is really missing it and not acknowledged in the email body, and the unreadable attachments, which are often scanned forms. Levelling, the calls to subs and the final number stay with the estimator.
Run it on every project's bid deadline
The app already knows each project's bid date, so its scheduler sends POST /o/{org}/sessions for the estimator on the project at three points: the morning before, two hours before and thirty minutes before the deadline. Each carries the estimator's agent id as agent, the project, trades and latest addendum in input, and a request_id that is a UUID v5 of the project id and the time slot, so a retried job starts no second run.
The estimator can also press Refresh bids in the app at any time, which sends the same request, and each refresh is its own session with its own answer.
The use case this job follows, with its automation and trigger: Run an agent per customer task.
Why run it on Rush?
Each estimator's mailbox is their own, and their Microsoft sign-in stays in Rush's connection under their agent. The company keeps no Microsoft tokens and registers no Microsoft app, and a session's accounts names the mailbox each run read, so a contractor's IT lead can see exactly which runs opened which estimator's mail.
Bid day is the busiest hour of the week for every estimator at once, and each refresh is a separate session on its own computer, so estimators closing bids in the same hour run side by side up to the key's max_concurrent, and the rest wait as queued and start as slots free. Each session records the Graph calls it made and what its model calls cost, which the company can total per estimator with GET /o/{org}/sessions?agent=<agent id>.
Frequently asked questions
Can the agent reply to subs who left something out?
Not with this template. It names Outlook at the read level, so the sign-in never asks for Mail.Send. Microsoft issues a token with every Outlook permission the person has granted Rush, so an estimator who connected Outlook with sending for another job keeps that grant, but this template's instructions still forbid replying.
What about bids sent as links to a file-sharing site?
The agent reads attachments. A message whose bid is a link goes into the unmatched list with the reason, and the estimator opens it. A company that sees many of those could add a step that downloads public links, with the estimator's agreement.
What if a sub uses a different project name in the subject?
That is why the prompt searches twice, by project number and by a word from the name. A bid that matches neither will not be found, so the app reminds estimators to put the project number in the invitation subject, which most subs reply to.
Does it decide which bid to carry?
No. It marks the low number in each trade and lists the exclusions beside it. Whether the low bid is the right one depends on scope, the sub's record and the schedule, which are the estimator's judgment.
More Outlook jobs
- Which Candidates Emailed Us and Never Heard Back? A Recruiting App's Daily Check of Each Recruiter's Outlook
- Which Customer Quote Requests Have We Not Answered? A Wholesale Distributor's Morning Check of Each Sales Rep's Outlook
- How Can Agency Software Pull Every Certificate of Insurance Request Out of Each Agency's Outlook Inbox? One Read-Only Agent per Agency