What the agent does
This is for a property management company that runs repairs through one Slack channel. Leasing agents and building supervisors post each tenant request in #maintenance as its own message: the building and unit, what is wrong, and whether the tenant allows entry. A technician claims a request by reacting with :eyes: or answering in its thread, and marks it finished with :white_check_mark:. The convention works until a busy Monday, when a dripping tap posted Friday evening sits under dozens of newer messages with no reaction at all. The maintenance coordinator wants one list before the vans leave: what nobody has picked up, and what was picked up and then went quiet.
The coordinator connects Slack once with POST /me/connections {"type": "app", "name": "slack"} and opens the authorize_url. Rush's Slack sign-in gives the agent the slack command-line tool acting as the coordinator, with the permissions to list and read public and private channels and their history, look up users, and post messages. The agent therefore sees exactly the channels the coordinator belongs to, and the request names slack in connections, since a key's run gets only the connections it names.
On a run the agent calls conversations.list to find the channel id of #maintenance, then conversations.history with oldest set to the Unix time fourteen days back, following response_metadata.next_cursor until the history ends. It keeps top-level messages only, and for each one reads the reactions the message carries and its reply_count. Where a thread exists it calls conversations.replies and checks whether anyone on the technician list in the prompt answered. A request with no claim reaction and no technician reply is Unclaimed. One that was claimed more than three days ago with no done reaction is Stalled. Everything with :white_check_mark: is left out.
It names each request by the poster (users.info), the building and unit as written, and how many hours it has waited, and links the message with chat.getPermalink. Requests whose text contains words the coordinator listed as urgent (leak, no heat, no hot water, lockout, gas) go to the top with the word quoted, so the coordinator decides how urgent they are rather than the agent. It writes unclaimed.md and posts one summary to #maintenance-leads. It never reacts to a request, never replies in a request's thread and never messages a tenant or a technician.
Start it with one API call
POST https://api.phoenix.so/o/{org}/sessions with this body:
{
"agent": "claude",
"input": "Check #maintenance for requests nobody has picked up. Use the slack tool. Find the channel id with conversations.list (exclude_archived=true, follow next_cursor). Read conversations.history from 14 days ago until now, following next_cursor, and keep only top-level messages. Technicians: U04TECH01 (Marco), U04TECH02 (Dee), U04TECH03 (Sam). A request is Claimed if it has an :eyes: reaction or a technician replied in its thread (read threads with conversations.replies when reply_count > 0), and Done if it has a :white_check_mark: reaction. List as Unclaimed every request that is neither, and as Stalled every request Claimed more than 3 days ago and not Done. For each give: poster (users.info), building and unit as written, the request text quoted, hours waiting, who claimed it if anyone, and a link from chat.getPermalink. Put first any request containing leak, no heat, no hot water, lockout or gas, quoting the word. Write unclaimed.md with Unclaimed, then Stalled, oldest first. Post one message to #maintenance-leads with the counts and the five oldest Unclaimed links. Do not react to, reply to or edit any message in #maintenance, and send no direct messages.",
"connections": [
"slack"
]
}- 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 session returns unclaimed.md as an artifact and the same list in result, and the leads see the short version in #maintenance-leads when they start the day. Each line links back to the original request, so the coordinator assigns it where the team already works: by replying in that thread or calling the technician. The agent's output is a list, not a work order, and the transcript records every Slack method it called.
What the coordinator checks before acting: a request a technician claimed by phone or in person, which Slack cannot show and which the list will call Unclaimed until someone reacts; requests posted twice for the same unit, which the agent lists separately as written; and anything marked urgent, where the quoted word decides nothing on its own. A tenant who reported a gas smell is a call to the emergency line, not a line in a report.
Run it on every weekday morning before dispatch
In the console, a Project automation with a schedule trigger runs a saved agent whose connections name slack, with this prompt and the company's timezone, at 30 7 * * 1-6: Monday to Saturday, since Saturday emergencies still need an owner. The automation runs as the coordinator, so it reads the channels they belong to and posts in #maintenance-leads as them.
When a technician joins or leaves, the coordinator edits the technician list in the saved agent's prompt. Each morning is its own session, so last week's lists stay readable beside today's, which helps when a tenant says they reported something days ago.
The use case this job follows, with its automation and trigger: Produce a report or file, no repo.
Why run it on Rush?
The check needs to read a private operations channel as a person who belongs to it. On Rush that sign-in sits in the coordinator's connection rather than in a bot token on someone's laptop, and every run acts as that one account. The prompt and the transcript together show the agent only read the channel and wrote one post where the prompt said.
Each run has its own computer and a record of every call it made and what its model calls cost, so the morning check has a known cost per day. A cron script could count reactions too, but it could not read a thread reply like "on it after lunch" and decide that a technician has taken the job, which is the part that keeps the list honest.
Frequently asked questions
What if our technicians claim jobs differently, with a different emoji or a word?
Change the prompt. The agent reads whichever reaction names and thread phrases the coordinator lists as a claim, and the reactions on a message come back with its history. Writing the convention down in the prompt also tends to make the team use it more consistently.
Can it assign the request to a technician itself?
It could post, since the sign-in can write messages, but this prompt forbids replying in request threads. Assignment stays with the coordinator, who knows who is already on site at which building. A later version could post a suggested assignee in #maintenance-leads for the coordinator to confirm.
Does it read tenants' messages or our private channels?
It reads what the coordinator can read, and the prompt points it at #maintenance only. Tenants are not in the workspace in this setup; their requests arrive through staff. If tenant details such as phone numbers appear in a request, they are in the run's record, which is readable by whoever started it and the org's owner and admins.
We use a separate channel for each building. Does that work?
Yes. Name the channel prefix instead of one channel, and the agent reads each channel the coordinator has joined that matches. The report then groups by channel, and lists any building channel the coordinator is not a member of as unread.
More Slack jobs
- Find Customer Questions Nobody Answered in Your Shared Slack Channels
- How Can a Courier Company List Each Day's Failed Deliveries by Client? An Agent That Reads the Drivers' Slack Channels Every Evening
- How Do I Run an Async Standup in Slack Without a Standup Bot? A Remote Marketing Agency's Daily Thread and Summary
More jobs like this: Produce a report or file, no repo
- Which New Federal Grants Could Our Nonprofit Apply For? A Watershed Group's Weekly Grants.gov Digest (Public websites)
- Which of Our Target Companies Posted New Roles This Week? A Recruiting Agency's Careers-Page Check (Public websites)
- Find New Public Bid Opportunities for a Construction Contractor Every Week (Public websites)