# What Happened at Each Location Last Night? A Restaurant Group's Morning Digest of Slack Shift Notes

A restaurant group's agent reads each location's end-of-shift notes in Slack every morning and posts one digest of 86'd items, broken equipment and call-outs.

[Run this on Rush](https://cloud.getrush.ai/run/summarize-overnight-shift-notes/slack/). Opens the console with this prompt ready to send. Connect Slack there first.

## What the agent does

This is for a restaurant group with several locations, where each closing manager writes an end-of-shift note in that location's own Slack channel: `#shift-downtown`, `#shift-airport`, `#shift-harbor`. A note covers the night's covers, what ran out, what broke, who called out, comps and voids, a guest complaint, a delivery that came short. The operations director reads every channel before the first lunch prep, and on a busy morning a walk-in cooler that has been running warm for three nights gets lost between a staffing note and a menu question. The agent reads the channels for them and writes one digest. The run names one connection, `slack`, signed in as the operations director, who is already a member of every shift channel.

Rush's Slack sign-in gives the agent the `slack` command-line tool, which calls Slack's Web API as that person with `slack api <method> key=value`. The token stays outside the agent's computer, and the sign-in asks Slack for reading public and private channels and their history, `users:read` and `chat:write`. The agent calls `conversations.list` with `types=public_channel,private_channel` and `exclude_archived=true`, follows `response_metadata.next_cursor` until the list ends, and keeps the channels whose names start with the prefix in the input. A location whose channel the director has not joined is listed by name as unread.

For each shift channel it calls `conversations.history` with `oldest` set to the Unix time of 2 p.m. yesterday, so it gets the closing note and anything the morning crew added, and opens every thread with `conversations.replies`, because a sous chef often answers the manager's note in the thread ("fryer 2 is fine, it was the breaker"). It calls `users.info` once per author to put a name on each note. It also reads the previous three days of the same channel, only to notice repeats: a piece of equipment reported down on three nights in a row is a different problem from one reported once.

From each note it pulls what the director acts on: items 86'd and whether the manager said why, equipment down or acting up, staff call-outs and no-shows for tonight's shifts, guest complaints, comps or voids the note calls out, and vendor shortages. It quotes the manager's own words for each line rather than paraphrasing a number. A location with no note since 2 p.m. yesterday is flagged at the top. It writes `digest.md` and posts one message with `chat.postMessage` to the internal channel named in the input. It never posts in a location's channel and never messages a manager or a cook.

## Start it with one API call

`POST https://api.phoenix.so/o/{org}/sessions`

```json
{
  "agent": "claude",
  "input": "Use the Slack connection. List public and private channels with conversations.list (exclude_archived=true, follow next_cursor) and keep the ones whose names start with shift-. For each one you are a member of, read messages since yesterday 14:00 America/Chicago with conversations.history and every thread with conversations.replies; also read the 3 days before that only to find repeats. Use users.info to name each author. For each location write: closing manager, items 86'd (with the reason if given), equipment down or acting up (mark REPEAT if it was reported on an earlier day), call-outs and no-shows for tonight, guest complaints, comps or voids the note mentions, and vendor shortages. Quote the note's own words; never invent a number. Put any location with no note since yesterday 14:00 at the top, then equipment repeats. Write digest.md and post one message to #ops-leads with the top items and a link to each note (built from the channel id and ts). List shift channels you are not a member of. Never post in a shift- channel and never message anyone directly.",
  "connections": [
    "slack"
  ]
}
```

1. **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.
2. **Send the request.** POST the body in request.json to https://api.phoenix.so/o/{org}/sessions, with your repository as the resources URL. The run starts in its own cloud sandbox.
3. **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 `digest.md` as an artifact and the same digest in `result`, and the leads see the short version in `#ops-leads` before the first prep shift starts. Each line links to the manager's own note, so the director can open the thread and reply there themselves. Calling the refrigeration company, moving a cook between locations or comping a guest's next visit stays a person's decision.

What the director checks: a note posted late, after the run read the channel, which shows up in tomorrow's digest instead; anything the agent marked as a repeat, against the earlier note it links; and a line where the note was ambiguous, such as "walk-in at 41 again" with no unit. The agent quotes those as written rather than deciding what they mean. The transcript lists every Slack method it called and on which channel, so a note that is missing from the digest can be traced to what the agent saw.

## Run it on every morning before prep

In the console, a Project automation with a `schedule` trigger, `cron` `0 8 * * *` and the group's `timezone`, runs a saved agent whose connections name `slack` with this prompt every day, weekends included, since restaurants close late on Saturday too. The automation runs as the operations director, so it reads the channels they belong to and posts as them in `#ops-leads`.

When the group opens a location, its manager posts in a new `#shift-` channel and the director joins it; the next morning's run includes it with no change to the prompt. Each morning is its own session, so last Tuesday's digest stays readable next to today's.

## Why run it on Rush?

A Slack workflow form would make every manager fill in fixed fields at 1 a.m., and a bot would need installing in the workspace and adding to each shift channel. The agent reads the notes the way managers already write them, as free text with replies underneath, and the run reads as the director who is already in every channel. Slack's sign-in stays in Rush's connection, not in a script on someone's laptop.

Each run has its own computer, so nothing depends on a machine left on overnight. It keeps a record of every Slack call and its cost, and the morning digest is never a guess about where a line came from: each item links to the message it was taken from.

## Frequently asked questions

### Do our managers need to change how they write shift notes?

No. The agent reads free text and threads. A consistent first line, such as the location name and date, helps it tell the closing note from the day's other messages, but it is not required.

### Can it read photos managers attach, like a picture of a broken dish machine?

Rush's Slack sign-in does not ask Slack for permission to read files, so the agent works from the text only. The digest links to the message, and the director opens the photo there.

### Will it reply to managers or tag people?

No. The prompt allows one post, the digest in `#ops-leads`, and forbids posting in any shift channel or sending direct messages. Following up with a manager is the director's call.

### What if a shift channel is private?

The sign-in covers private channels the director is a member of, so those are read like any other. A private channel the director has not joined does not appear to them at all, so it cannot be read or listed.

## More Slack jobs

- [What Did Customers Ask Us to Build This Week? A SaaS Customer-Success Team's Friday Digest From Shared Slack Channels](https://getrush.ai/run/collect-feature-requests-from-customer-channels/slack/)
- [Find Customer Questions Nobody Answered in Your Shared Slack Channels](https://getrush.ai/run/find-unanswered-customer-questions/slack/)

## More jobs like this: Produce a report or file, no repo

- [Find Untested Code in an Angular App](https://getrush.ai/run/test-coverage-gaps/angular/)
- [Find the Test Coverage Gaps in a Django REST Framework API](https://getrush.ai/run/test-coverage-gaps/django-rest-framework/)
- [Find Untested Code in a Flask App](https://getrush.ai/run/test-coverage-gaps/flask/)
- [Find Test Coverage Gaps in a Gin Service](https://getrush.ai/run/test-coverage-gaps/gin/)

## Keep reading

- [Connect Slack to Rush once, then name it on any run](https://getrush.ai/integrations/slack/)
- [Start your first run from the developer API quickstart](https://getrush.ai/docs/quickstart/)
- [Rush pricing: Free, Pro and Max](https://getrush.ai/pricing/)
