What this workflow does
- Tenant text (Twilio) (Webhook) receives the text and any photo links.
- Normalize and emergency screen (Code) runs a fixed keyword rule first. Gas, smoke, fire, carbon monoxide and sparking are life-safety. Flooding, leaks through a ceiling, sewage, no heat and lockouts are urgent. Opt-out words are noted so the workflow never replies to them.
- Find tenant by phone (Google Sheets) matches the number to a tenant, property and unit.
- Route and build prompt (Code) decides the path. Life-safety texts skip the model entirely.
- Route request (Switch) sends life-safety texts to Twilio: reply to tenant (the scripted safety message) and Slack: page on-call at the same time, unknown numbers to the exceptions channel, and the rest to classification.
- Claude: classify request (HTTP Request) returns trade, priority, a two-line summary, location, start time, entry permission, pets, missing details and a reply in the tenant’s language, as strict JSON.
- Parse and pick vendor key (Code) handles
refusal,max_tokensand API errors with a safe fallback, and never lets the model downgrade an urgent keyword hit. - Find preferred vendor (Google Sheets) looks up the vendor and not-to-exceed amount for that trade and property.
- Append work order (Google Sheets) writes the work order as “Ready” or “Needs review” with reasons. Twilio: reply to tenant confirms the request or asks for one missing detail.
- Slack: maintenance exceptions gets unknown numbers and failed sends.
Before you import
- A Twilio number for maintenance texts and an Anthropic API key.
- A Google Sheet with Tenants, Vendors and Work orders tabs, and a Slack app with
chat:write. - If you want work orders created in your PM software, check your API access. Buildium publishes an API that is available on certain plans; AppFolio and Yardi usually require partner or customer-specific approval.
Setup
- Build the three tabs. Use E.164 phone numbers and add the column headers shown on the Append work order node.
- Set the Twilio number’s incoming message webhook to the production URL.
- With your maintenance lead, review
LIFE_SAFETY,URGENTand the scripted safety reply, and replaceREPLACE_WITH_EMERGENCY_PHONE. - Replace
REPLACE_WITH_SHEET_ID,REPLACE_WITH_TWILIO_NUMBER,REPLACE_WITH_ONCALL_CHANNEL_IDandREPLACE_WITH_MAINTENANCE_CHANNEL_ID.
Test it
Text “I smell gas” from a test number and confirm the safety reply and the on-call page arrive within seconds, with no model call. Text a leaky sink in Spanish with a photo and check the work order row and the Spanish reply. Text from a number not in the Tenants tab and confirm it lands in Slack.
Make it production-ready
- Replay a few months of real past messages through the keyword screen. A chirping smoke alarm battery will page on-call, which is the right side to err on.
- Replace the sheet append with a call to your PM software’s work order API once you trust the classification, or keep the sheet as a review queue.
- Add owner approval above a dollar threshold, vendor dispatch and reminders, and follow your state and local entry notice rules.
- Add an error workflow, and limit follow-up questions to a few before creating the work order anyway.
claude-haiku-5-5is a cheaper option at high volume.
Read the full guide at How to automate tenant maintenance requests, or talk to us about connecting your PM software.