What the agent does
This is for a regional courier company: thirty vans on fixed routes, delivering for a few dozen business clients such as pharmacies, auto parts suppliers, print shops and online stores. Drivers report problems as they happen in a Slack channel per route, #route-north, #route-east and so on, from their phones: nobody home, business closed, wrong address, refused, damaged parcel, a parcel left at the depot. Dispatchers act on them in the moment, but every evening someone has to turn the day's messages into two things: the list of parcels to redeliver tomorrow, and a note to each client about their failed deliveries. The agent reads the channels after the last van is back and writes both.
The dispatch lead connects Slack once with POST /me/connections {"type": "app", "name": "slack"}. Rush's Slack sign-in gives the agent Slack's Web API signed in as the dispatch lead, who is already in every route channel, with reading public and private channels and their history, reading user names, and posting messages. The run names slack in connections, and the prompt limits where it may post.
On a run the agent calls conversations.list to find the channels whose names start with route-, then conversations.history on each with oldest set to the Unix time of the start of the working day; Slack's reference says only messages after that timestamp are returned and that a page holds up to 999, with next_cursor for more. Because a dispatcher often answers a driver in a thread ("try again after 3, the shop reopens"), it opens each thread with conversations.replies, and it uses users.info to name the driver. It reads photos' captions but not the images.
From each report it takes the tracking or parcel number, the client (from the number's prefix, as the request lists them), the address, the reason in the driver's words, and what the thread says happened next: delivered on a second try, returned to the depot, or left open. It writes redelivery.csv with every parcel still undelivered and a suggested route for tomorrow, client-notes.md with one short draft note per client listing their failed parcels and the reason, and posts one summary message to the internal #dispatch-leads channel. It never posts in a route channel and never messages a driver or a client.
Start it with one API call
POST https://api.phoenix.so/o/{org}/sessions with this body:
{
"agent": "claude",
"input": "Evening failed-delivery report for Swift Lane Couriers, date 2026-11-20, time zone America/Denver. Use the slack connection. Call conversations.list (types public_channel,private_channel, exclude_archived true, follow next_cursor) and keep channels whose names start with route-. For each, call conversations.history with oldest = Unix time of 2026-11-20 06:00 America/Denver, following next_cursor, and conversations.replies for every thread; name authors with users.info. Find every report of a delivery that did not happen. Client by parcel prefix: RX = Mesa Pharmacy, AP = Front Range Auto Parts, PR = Copper Print Co, other = unknown. For each parcel: parcel number, client, address, reason in the driver's words, driver, route, and outcome from the thread (delivered on retry, at depot, or open). Write redelivery.csv (parcel, client, address, reason, original_route, suggested_route, outcome) for everything not delivered, client-notes.md with one 3-sentence draft note per client listing their parcels and reasons, and post one message to #dispatch-leads with the count per client and the parcels with no outcome. Never post in a route- channel and never message anyone directly. Do not include customer phone numbers in any file.",
"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's artifacts hold redelivery.csv, every parcel still undelivered at the end of the day with the client, the address, the driver's reason and a suggested route for tomorrow, and client-notes.md, one short draft note per client naming their failed parcels and why. One message in #dispatch-leads gives the count per client and the parcels whose thread has no outcome, which are the ones to chase before morning.
What the dispatch lead checks before using it: parcels whose outcome is open, since a driver may have delivered one and not said so; a reason the agent quoted but a client will read badly, such as "customer was rude", which a person rewrites; and the suggested routes against tomorrow's real loads. The lead sends the client notes from the company's own email and loads the redelivery list into the routing tool.
Run it on every evening after the last van returns
In the console, a Project automation with a schedule trigger, cron 30 19 * * 1-6 and the company's timezone, runs a saved agent whose connections name slack with this prompt, Monday to Saturday. A schedule fills no date into the prompt, so the instructions say "today in the company's time zone" and the agent works out the Unix time itself.
When a new route starts, the dispatch lead creates its #route- channel and joins it, and the next evening's run includes it with no change to the prompt. Each evening is its own session, so a client who disputes a failed delivery a week later can be answered from that day's record.
The use case this job follows, with its automation and trigger: Produce a report or file, no repo.
Why run it on Rush?
The Slack sign-in stays in Rush's connection and is signed outside the agent's computer, rather than in a bot token kept on a dispatcher's laptop. The run reads only the channels the dispatch lead belongs to, and its record shows every channel and thread it opened and the one message it posted, so the company can see exactly what it did with drivers' messages.
Drivers write the way people type on a phone in a van, and the reason and the outcome are often split between a message and a thread reply an hour later. A fixed script that matches keywords misses those; the agent reads the conversation. Each run has its own computer and its own total_cost_usd, which the company can set against the hour a dispatcher spent on the same list every evening.
Frequently asked questions
Can the agent send the client notes itself?
Not on this page. Its only Slack post is the internal summary, and it has no email connection. A client hears about a failed delivery from a person at the company, who can add context the driver's message did not have.
What if drivers post photos instead of text?
The agent reads message text and captions, not images. Ask drivers to type the parcel number and a word or two with each photo; the dispatch lead can pin that rule in each route channel.
Does it need its own Slack bot?
No. The run uses the dispatch lead's Slack connection, so it reads what they can read and posts as them in the one channel the prompt allows. Leaving the dispatch lead out of a channel keeps the agent out of it too.
How does it tell which client a parcel belongs to?
From the parcel number's prefix, listed in the prompt. A parcel with an unknown prefix is listed under unknown rather than guessed, and the dispatch lead adds the new prefix to the saved agent's instructions.
More Slack jobs
- How Do I Run an Async Standup in Slack Without a Standup Bot? A Remote Marketing Agency's Daily Thread and Summary
- What Happened at Each Location Last Night? A Restaurant Group's Morning Digest of Slack Shift Notes
- How Do I Collect Each Location's Weekly Numbers From Slack? A Fitness Franchise's Monday Table From Its Studio Managers' Posts
More jobs like this: Produce a report or file, no repo
- Which Hotel Suppliers Failed Our Searches and Bookings Yesterday? A Travel Booking Site's Morning Report From Datadog Logs (Datadog)
- Which Invoice Emails Bounced This Week? Invoicing Software for Tradespeople Lists Them From Resend (Resend)
- Which Clients Still Owe Us Documents? An Accounting Firm's Weekly Check of Client Folders in OneDrive (OneDrive)