# Flag Loads at Risk of Missing Delivery in a Freight Broker's Airtable

A freight broker's agent reads open loads in Airtable each morning, finds the ones at risk of a late delivery and lists the check calls a dispatcher should make.

[Run this on Rush](https://cloud.getrush.ai/run/flag-late-loads/airtable/). Opens the console with this prompt ready to send. Connect Airtable there first.

## What the agent does

This is for a freight brokerage or a small logistics company that tracks its loads in an Airtable base instead of a transport management system: one row per load with the carrier, the pickup and delivery appointments, a status and the time and note of the last check call. Each morning a dispatcher scrolls the table looking for trouble. The run names one connection, Airtable's remote MCP server, connected once with `POST /me/connections {"type": "mcp", "name": "airtable", "url": "https://mcp.airtable.com/mcp", "auth": {"mode": "oauth"}}`. On Airtable's consent page the person picks which bases and workspaces it may reach, so it can be limited to the loads base.

The agent learns the base before reading it. It calls `search_bases` to find the base by name, `list_tables_for_base` to find the loads table, and `get_table_schema` for its fields, so it uses the base's real field names and types instead of assuming them. Then it calls `list_records_for_table` with a filter for loads whose status is not delivered or cancelled, and reads every page of them.

For each open load it applies the rules in its input: the delivery appointment has passed and the load is not delivered; the delivery appointment is within the next six hours and the last check call is more than four hours old; or the pickup appointment has passed and the status still says it is waiting for pickup. A load that trips a rule goes on the list with the rule it tripped, the carrier, the appointment, the last check call and its note, so the dispatcher sees why it is there.

Then it marks the list in Airtable itself. The base has a checkbox field the brokerage added for this, `Needs check call`, and the agent sets it on each flagged load with `update_records_for_table`, which changes only the fields it names, and clears it on loads that no longer trip a rule. It touches no other field: status, appointments and notes stay with the dispatchers.

## Start it with one API call

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

```json
{
  "agent": "claude",
  "input": "Use the Airtable connection. Find the base named Loads and its table Loads, and read the table's schema first. List every record whose Status is not Delivered or Cancelled. Flag a load if: (a) Delivery Appointment has passed and it is not Delivered; (b) Delivery Appointment is within the next 6 hours and Last Check Call is more than 4 hours ago or empty; or (c) Pickup Appointment has passed and Status is Awaiting Pickup. Times are in America/Chicago. Set the checkbox Needs check call to true on flagged loads and false on open loads that are not flagged; change no other field. Write at_risk.md, most urgent first, with load ID, rule, carrier, appointment, last check call and its note, and return a count per rule.",
  "connections": [
    "airtable"
  ]
}
```

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 run leaves two things. In Airtable, the `Needs check call` box is ticked on every flagged load, so a view filtered on it is the dispatcher's call list for the morning. In the session, `at_risk.md` lists the same loads most urgent first with the rule each one tripped, and `result` carries the count per rule, which the brokerage can post to its team channel.

The dispatcher still makes the calls and updates the status. Before acting on the list, they check loads flagged under rule (b) whose carrier sends updates by another route, such as a tracking link the base does not record. The transcript keeps every Airtable call the agent made, including each `update_records_for_table` with the record ids it changed, so a box ticked by mistake can be traced.

## Run it on every weekday morning

In the console, a Project automation with a `schedule` trigger (`30 6 * * 1-5` with the brokerage's timezone) can run a saved agent that names the Airtable connection and holds these rules, so the list is ready before the first dispatcher logs in. A second slot after lunch catches the afternoon deliveries.

A brokerage with its own dispatch app can instead call `POST /o/{org}/sessions` from it, with a `run.completed` webhook on the API key that posts the counts where the team will see them.

## Why run it on Rush?

The rules for what counts as at risk are simple to say and fiddly to run by hand across every open load, with mixed timezones and empty fields. The agent reads the schema, applies the rules the brokerage wrote, and explains each flag, so the call list is the same whoever is on shift.

Airtable's sign-in stays in a Rush connection, limited on Airtable's side to the bases the person picked, and each run has its own computer and its own record of what it read and which records it changed. The brokerage adds a rule by editing a prompt, not by rebuilding an automation.

## Frequently asked questions

### Can it change a load's status or appointment?

The prompt allows only the `Needs check call` checkbox, and `update_records_for_table` changes only the fields a call names. Status and appointments stay with the dispatchers, who know what the carrier actually said.

### What permissions does the Airtable connection need?

The person who connects it must be able to edit records in the loads base. Airtable's consent page lets them pick the bases the connection reaches, and an editor can change records but not the base's schema.

### Does it call the carriers?

No. It works from what the base records and lists the calls to make. A dispatcher calls, then updates the last check call fields, which clears the flag on the next run.

### Our field names are different. Does that matter?

Use your names in the prompt. The agent reads the table's schema before it reads records, so it fails clearly on a field that does not exist rather than guessing.

## More Airtable jobs

- [How Does a Property Manager Triage Each Morning's Maintenance Requests in Airtable?](https://getrush.ai/run/triage-maintenance-requests-each-morning/airtable/)
- [Which Donors Gave Last Year but Not This Year? A Fundraising App's Monthly Airtable Check for Each Nonprofit](https://getrush.ai/run/find-lapsed-donors/airtable/)
- [Flag Products in Each Online Store's Airtable Catalog That Are Not Ready to List](https://getrush.ai/run/flag-incomplete-product-listings/airtable/)

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

- [Flag Overdue Maintenance Work Orders on a Property Manager's monday.com Board](https://getrush.ai/run/flag-overdue-work-orders/monday/)
- [Audit Klaviyo Flows](https://getrush.ai/run/flow-audit/klaviyo/)
- [Follow Up on Overdue QuickBooks Invoices Every Week](https://getrush.ai/run/follow-up-on-overdue-invoices/quickbooks/)

## 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/)
