RFI Triage
Auto-classify incoming RFIs (Requests for Information) by trade, priority, and cost/schedule impact. Logs each to a Sheet and alerts the PM.
What it does
Every ~15 minutes during work hours:
- Reads Gmail messages with the label
rfi-incoming(set by your Gmail filter). - For each message, asks Claude to classify it: which trade does it belong to, how urgent, how expensive, who should review.
- Appends the classification to an
RFILogGoogle Sheet. - Relabels the email
rfi-triagedso the next poll skips it. - Sends the PM a digest of newly-classified RFIs.
Pattern note
This workflow uses a single runtimeenv task with BOTH the Google Workspace AND Anthropic credentials injected via credentialNames. The script does everything: fetches Gmail, calls Claude, writes to Sheets, modifies labels.
Why not strict hybrid (separate tool tasks per operation)? Because the data flow has variable-length lists (N emails → N classifications → N sheet rows → N label modifications). Splitting into 6+ tasks would force JSON-through-template-substitution for each step. One task with credentialNames is dense but coherent.
Setup
1. Gmail labels + filter
In Gmail:
- Create label rfi-incoming.
- Create a filter that applies the label to incoming RFIs. Common patterns: subject contains "RFI" or "Request for Information", or replies on threads from your designers.
- Create label rfi-triaged.
2. Service account Gmail access
The service account needs to read AND modify the relevant mailbox. In Google Workspace admin:
- Enable domain-wide delegation for the service account.
- Grant scopes: https://www.googleapis.com/auth/gmail.readonly AND https://www.googleapis.com/auth/gmail.modify.
- Set the credential's account field to the mailbox owner's email so gog impersonates them.
(For individual Gmail accounts outside Workspace, OAuth is required — service account won't work. This workflow assumes Workspace.)
3. Sheet
Tab RFILog with this header:
| rfi_id | received_at | project | trade | priority | cost_impact | schedule_impact_days | summary | suggested_reviewer | raw_subject | status |
|---|---|---|---|---|---|---|---|---|---|---|
4. Credentials
<<GOOGLE_WORKSPACE_CREDENTIAL>>— Workspace service account with Gmail modify + Sheets write<<ANTHROPIC_CREDENTIAL>>— Anthropic API key credential
5. Edit placeholders + schedule
In workflow.yaml:
- <<RFI_LOG_SHEET_ID>>
- <<DEFAULT_PROJECT_NAME>> (used until per-message project detection is added)
- <<PM_PUBLISHER>>
Schedule: every 15 min during work hours.
What it won't do
- Reply to the RFI on the user's behalf (intentional — RFIs need PM judgment).
- Detect project membership from the email body. v1 stamps everything with one default project name. For multi-project, run one workflow instance per project with different Gmail filters.
- Read PDF attachments inline. Most RFIs are text email; the classification works on subject + body. Heavy-attachment RFIs may need a follow-up review.
AI cost
Per-RFI classification: ~600 tokens prompt, ~150 tokens response with Claude Sonnet 4.6. Maybe $0.005 each. A shop receiving 20 RFIs/day = ~$3/month.