# Which Tours Next Week Are Still Below Their Minimum Group Size? A Tour-Operator App Checks Each Operator's Airtable Every Morning

A guest-messaging app for small tour operators makes one agent per operator, signed into its Airtable, that lists departures below minimum before the cutoff.

[Run this on Rush](https://cloud.getrush.ai/run/find-tour-departures-below-minimum-group-size/airtable/). Opens the console with this prompt ready to send. Connect Airtable there first.

## What the agent does

This is for a software company that sells a guest-messaging app to small tour operators: city walking tours, food tours, kayak and bike day trips, small-group wine country outings. Many of its operators run their schedule in an Airtable base rather than a booking system: a Departures table with the tour, date, start time, guide, minimum and maximum group size and a cutoff (usually 48 or 72 hours before), and a Bookings table linked to it with the lead guest, party size and status. A departure that has not reached its minimum by the cutoff is cancelled or merged with another date, and the guests need to hear in time to rebook. The app adds a morning list of the departures that are at risk, with draft messages, read from each operator's own base.

The company connects an Airtable account of its own and saves the agent once as a template with `POST /o/{org}/agents`, naming `airtable` in `connections` and instructions that allow reading only. When an operator turns the list on, the app's backend calls `POST /o/{org}/agents {"template": "<template id>", "name": "departures-<operator id>"}`, stores the agent id against the operator, then calls `POST /o/{org}/agents/{agent}/connections {"type": "mcp", "name": "airtable"}` and opens the `authorize_url` in a popup. Airtable's docs say the operator chooses which bases and workspaces to connect during that sign-in, and that the server acts with the operator's own permissions, so the app asks them to pick only the schedule base.

On a run the agent calls `search_bases` to find the base by the name the operator gave in setup, `list_tables_for_base` and `get_table_schema` to find the Departures and Bookings tables and their fields, then `list_records_for_table` with a filter for departures in the next eight days that are not already marked Cancelled. For each departure it adds up the party sizes of its linked bookings whose status is Confirmed, and compares the total with the minimum. A departure is at risk when it is below its minimum and its cutoff is within the next 48 hours; it is a watch item when it is below minimum with more time left.

For each departure at risk, the agent looks for another departure of the same tour within three days that has room for the whole group, and drafts two messages for the operator: one offering the guests that date, one explaining a cancellation and refund. It never edits a record, cancels a departure, or contacts a guest; the drafts go back to the app, where the operator chooses.

## Start it with one API call

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

```json
{
  "agent": "<agent id>",
  "input": "Morning departures check. Now: 2026-11-23 07:00, time zone America/New_York. Base: 'Tours schedule'. Read only: create, edit or delete no record, field or table. 1) search_bases for the base; list_tables_for_base; get_table_schema for Departures and Bookings. 2) list_records_for_table on Departures: date from 2026-11-23 to 2026-11-30, status not Cancelled. 3) For each departure, read its linked Bookings and add up Party size where Status is Confirmed. 4) At risk: confirmed guests < Minimum and Cutoff within 48 hours of now. Watch: confirmed guests < Minimum and Cutoff later. 5) For each at-risk departure, find departures of the same Tour within 3 days either side with Maximum minus confirmed guests >= this departure's guests. 6) Draft two messages per at-risk departure, under 90 words each, signed with the operator's name from the base: a move offer naming the alternative date and time, and a cancellation notice saying a full refund will follow. Return JSON only: {checked_at, at_risk: [{departure_id, tour, date, start, guide, confirmed, minimum, cutoff, alternatives: [{departure_id, date, start, seats_free}], move_message, cancel_message}], watch: [{departure_id, tour, date, confirmed, minimum, cutoff}]}. Include no guest email or phone number."
}
```

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. 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

What comes back is the JSON in the session's `result`, which the `run.completed` webhook carries to the app's server: the departures at risk with their confirmed guests, minimum, cutoff and any alternative dates with room, two drafted messages for each, and a watch list of departures that are short but still have time. The app shows it as a morning card and lets the operator send a draft to the booked guests from the app.

What the operator checks before anything goes out: that the confirmed count is right, since a booking taken by phone may not be in the base yet, and whether a guide could run the tour anyway for a small group, which no table records. The cancellation draft promises a full refund because the prompt says so; an operator with another policy sets that line in the app's settings, which the app writes into the input, and still reads the draft before sending. Nothing in the base changes until the operator changes it.

## Run it on every morning in tour season

The app's scheduler sends `POST /o/{org}/sessions` with `{"agent": "<agent id>", "input": "…"}` for each operator at 7:00 in the operator's time zone, filling in the date range and the base name from the operator's settings, with a fresh `request_id`, a UUID, per operator and day so a retry does not start a second run.

On a day with a storm forecast, an operator can press "Check today" in the app, which starts the same agent with the window narrowed to the next 24 hours and the minimum ignored, to draft messages for every departure that day.

## Why run it on Rush?

Each operator's Airtable sign-in is held in Rush's connection under that operator's own agent, limited to the bases they picked, so one operator's run never sees another's schedule. The company never handles an Airtable token, and deleting an operator's agent when they cancel disconnects their base.

Each run has its own computer and a record of every record it read, so when an operator says a departure was wrongly flagged, support can see which bookings were counted. Many operators' checks run at the same hour without the company running its own job servers, and each agent's sessions, listed with `GET /o/{org}/sessions?agent=<agent id>`, add up to what that operator's model calls cost.

## Frequently asked questions

### Our operators name their tables and fields differently. Does that break it?

The agent reads each base's schema with `get_table_schema` before it reads any records, and the app's setup screen asks which table holds departures and which field is the minimum. The template's instructions say to use those names.

### Could the agent mark a departure Cancelled once the operator decides?

Airtable's server can update records when the operator's role allows it, but this template's instructions forbid it. The operator cancels in their own base, where their other automations, such as refunds, may already listen for that change.

### Why include no guest contact details in the result?

The app already knows how to reach the guests through its own messaging. Keeping email addresses and phone numbers out of the result means they are not copied into one more place.

## More Airtable jobs

- [Flag Products in Each Online Store's Airtable Catalog That Are Not Ready to List](https://getrush.ai/run/flag-incomplete-product-listings/airtable/)
- [Flag Loads at Risk of Missing Delivery in a Freight Broker's Airtable](https://getrush.ai/run/flag-late-loads/airtable/)
- [How Does a Property Manager Triage Each Morning's Maintenance Requests in Airtable?](https://getrush.ai/run/triage-maintenance-requests-each-morning/airtable/)

## More jobs like this: Run an agent per customer task

- [Which of This Week's Tutoring Sessions Have No Notes? Tutoring Centre Software Checks Each Centre's Google Drive](https://getrush.ai/run/find-tutoring-sessions-with-no-notes/google-drive/)
- [Which Customer Payments Never Got Applied to an Invoice? A Month-End Close App's Check of Each Client's QuickBooks](https://getrush.ai/run/find-unapplied-customer-payments/quickbooks/)
- [Flag Subcontractors' Expiring Insurance Certificates in Each Contractor's OneDrive](https://getrush.ai/run/flag-expiring-insurance-certificates/onedrive/)

## Keep reading

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