AI Routing Agent

One agent.

Four routing decisions.

Framework 03

A single monitoring agent watches every inbound system a case notification might land in, classifies the document it finds, and moves the deal to the correct stage — Won, Lost, Deferred, or no-change. Invoices for won cases are generated and queued for approval in the same pass.


Claude Google Drive API Trello Webhooks AWS Lambda HubSpot

By the numbers

In one look.

3

Watched triggers

4

Notification classes

4

Routing outcomes

Under 5 min

Time to route

REX BLACK · AI ROUTING AGENT
The problem

Notifications arrive everywhere.

In most services firms, the "you won the case" notification does not arrive in a neat webhook. It arrives as a PDF a paralegal scans into a shared Drive folder. Or as a Trello card someone creates from an email. Or as an email forwarded to a shared inbox. The operator's job used to be: watch all three, read every PDF, match it to the right deal, figure out whether it's a dependent notification, an exam scheduling notice, a favorable decision, or a denial — and then do different things for each.

That is a pure classification + extraction problem, and it's the ideal shape for a dedicated agent. The framework gives you one.


Scope — We configure one agent per firm, but it watches every inbound system you operate. Adding a new trigger (say, a Dropbox folder) is a config change, not a new build.

REX BLACK · AI ROUTING AGENT
Two live triggers

Where the notifications actually arrive.

Typical deployment uses both. The agent treats them identically once the document is in hand — same classifier, same extractor, same routing table.

  • Trigger 1 — Board-based (Trello, Asana, ClickUp)
  • Trigger 2 — Folder-based (Drive, Dropbox, S3)
REX BLACK · AI ROUTING AGENT
Trigger 1

Board-based (Trello, Asana, ClickUp)

Operators still want a "recent notifications" board they can eyeball. The agent subscribes to card-created webhooks on that board.

  • New card created by operator (from email, scan, or fax)
  • Agent reads card title, attached PDF, and comments
  • Classifies notification type, extracts client match by name + email
  • Attaches PDF to the matched deal in the CRM
  • Runs the routing decision (see below)
REX BLACK · AI ROUTING AGENT
Trigger 2

Folder-based (Drive, Dropbox, S3)

Paralegals and mailroom staff drop PDFs into a shared folder. The agent watches for new files with a debounced folder-watcher.

  • New PDF lands in the Active Decision Letters folder
  • Agent reads the full PDF, classifies it, extracts award amount if applicable
  • Matches to the deal by client name + case reference
  • Writes structured notes to the deal with favorably-resolved items, rates, dates
  • Runs the routing decision (see below)
REX BLACK · AI ROUTING AGENT
Workflow W10

Notification Classifier + Router

Trigger — New card created in Trello OR new file added to monitored Drive folder OR webhook from email forwarder

  1. AI — Read trigger source, identify client by name + email match against the CRM.
  2. AI — Download and parse the PDF notification / case file. Extract: notification type, effective date, items (with status + rate), award amount if present.
  3. IF/THEN — What type of notification?
  4. AI — DEPENDENT: Draft "dependent added" email. Generate invoice = award × contract fee %. Push invoice_amount to CRM. Email owner for approval. Task operator to send the client email.
  5. AI — EXAM SCHEDULED: Read items from deal notes, select matching prep-video clips (condition-specific library). Draft email with date, time, links. Task operator to review and send.
REX BLACK · AI ROUTING AGENT
Notification Classifier + Router · continued

Notification Classifier + Router

  1. AI — FAVORABLE DECISION: Extract award letter, calculate rate-percent increase. Generate invoice = award × contract fee %. Update deal notes with granted items + rates + dates. Draft congratulations email. Push invoice for approval.
  2. AI — ADVERSE DECISION: Update deal notes with denied items + dates + denial summary. Create task for senior operator: "Review denied case for [client] — appeal recommendation needed."
  3. ROUTE — Routing decision: Dependent or Exam → no stage change. ALL items favorable → Won. ALL items adverse → Lost. ANY item deferred → Deferred (hold).
  4. SET — Write invoice_amount, close_date, claim_decision to the deal. Downstream native workflows fire on stage transition.
  5. EXIT — Deal is in the correct stage. Rotting timers armed. Operator sees it on tomorrow's board.

Exit — Deal routed. Operator only sees cases that need human judgment (appeals, approvals).

REX BLACK · AI ROUTING AGENT
Routing logic

Four outcomes. Deterministic from the classification.

The classification is AI; the routing from classification to stage is plain code. This keeps the "why did the deal move?" question always answerable.

Classification Stage move What else fires
Dependent added No change Dependent-added client email drafted. Invoice generated + queued for approval. Operator task to send the client email.
Exam scheduled No change Prep-video selection run against the item list. Client email drafted with date, time, and links. Operator task to send.
All items favorable → Won close_date set. Invoice generated from award letter. Congrats email drafted. Sent to finance for approval. 15d rotting timer armed.
All items adverse → Lost close_date set. Deal notes updated with denial summary. Task to senior operator for appeal recommendation. 10d rotting timer armed.
Any item deferred → Deferred (hold) Deal holds until all items decided. Same classifier re-runs when the next notification arrives. No timer.
REX BLACK · AI ROUTING AGENT
Why this works

AI classification, code routing.

The reliability trick is the split. Classification is a language problem — what does this PDF say? Routing is a policy problem — given what it says, which stage goes with which label? We give the first to the agent and keep the second in plain code, version-controlled in the workflow repo.

The practical effect: when a firm changes its routing policy (say, deferred cases now need a separate specialist review before the hold), we change three lines of code and ship. No prompt engineering, no eval sets, no regressions on unrelated classifications.


Design principle — AI where judgment is needed. Code where determinism is needed. Never the other way around.

REX BLACK · AI ROUTING AGENT
Next step

Stop triaging

PDFs by hand.

If a senior operator is reading every inbound letter to decide what stage the case goes to, this is the framework. Works with whatever systems you already use — Trello, Drive, email, it does not matter.


Book a working session · rexblack.com/lets-talk
See the AI document processor · rexblack.com/frameworks/ai-document-processor

REX BLACK · AI ROUTING AGENT