General agents
AuraScore 83/100

Tenant Maintenance Triage and Dispatch State Machine Script

Build an intelligent agent script to parse tenant maintenance tickets, verify emergency parameters, and automate vendor dispatch within budget limits.

Use this template when implementing an automated property management agent for residential or commercial properties. It produces a state-driven script that categorizes issues, checks emergency SLAs, dispatches approved contractors, and verifies spending limits.

Template

Role: Lead Conversational AI and Workflow Engineer specializing in residential property operations and automated incident triage.

Context

  • Property management organization: {{property_management_co}}
  • Managed property portfolio type: {{property_portfolio_type}}
  • Designated emergency classifications: {{emergency_categories}}
  • Vendor dispatch gateway: {{vendor_dispatch_api}}
  • Autonomous spending authorization limit: {{spend_approval_limit}}
  • Urgent response SLA: {{after_hours_sla_minutes}}

Task

Design a resilient agent state-machine script in TypeScript/Node.js or Python that receives tenant maintenance inquiries for {{property_management_co}}, categorizes requests against {{emergency_categories}}, validates repair estimates against {{spend_approval_limit}}, and triggers automated vendor dispatch via {{vendor_dispatch_api}} under a {{after_hours_sla_minutes}}-minute SLA.

Method

  1. Define state machine states: Intake, Classification, SeverityAssessment, VendorMatching, AuthorizationCheck, Dispatch, and HumanHandoff.
  2. Ingest inbound tenant maintenance report text, extracting reported failure type, location, and tenant presence constraints.
  3. Evaluate extracted data against {{emergency_categories}} for {{property_portfolio_type}} units to assign urgency tier.
  4. Route non-emergency requests to standard queuing and schedule during normal operating hours.
  5. For emergency items, query {{vendor_dispatch_api}} to locate on-call trade specialists capable of meeting {{after_hours_sla_minutes}}.
  6. Evaluate vendor call-out estimate against {{spend_approval_limit}}.
  7. Auto-authorize and dispatch ticket if estimate is within limit; transition to HumanHandoff if threshold is exceeded.
  8. Send confirmation update to tenant with technician ETA and safety precautions.

Constraints

  • MUST implement deterministic state transitions with zero uncaught exception paths.
  • MUST NOT auto-dispatch unverified vendors not registered within the dispatch API.
  • The script MUST log every state transition with timestamped ISO telemetry for audit purposes.
  • Tenant communication strings MUST enforce standardized compliance and safety phrasing.

Output format

  • State Machine Definition and Type Interfaces
  • Intent Classification and Severity Evaluation Agent Nodes
  • Vendor Dispatch API Integration Functions
  • Main Execution Workflow Loop with Fallback Handlers
  • Example Input/Output Execution Scenario

Self-review

  • Confirm inclusion and active logical usage of all variables: {{property_management_co}}, {{property_portfolio_type}}, {{emergency_categories}}, {{vendor_dispatch_api}}, {{spend_approval_limit}}, {{after_hours_sla_minutes}}.
  • Validate that emergency branch guarantees SLA enforcement logic under {{after_hours_sla_minutes}}.
  • Ensure spend threshold guardrails cannot be bypassed by malformed input data.
AuraScore breakdown
83/100Provisional
Instruction clarity15/15 · Strong

Explicit role, a named task, and discrete steps the model can follow.

Context architecture12/12 · Strong

Background, inputs and variables the model needs before it starts.

Constraint engineering12/12 · Strong

Hard boundaries — what the model must and must not do.

Output specification6/14 · Thin

A named, field-level shape for the response.

Reasoning structure10/10 · Strong

Ordered work items that force analysis before an answer.

Model compatibility10/10 · Strong

Length and structure that travel across frontier models.

Token efficiency5/10 · Thin

Signal density — instruction weight without padding.

Reusability7/7 · Strong

Documented variables so the scaffold adapts to new inputs.

Robustness5/5 · Strong

Quality bar, assumptions and behaviour when inputs are thin.

Observed performance1/5 · Thin

How much real usage the template has behind it.

ai-agents
agents-general
real-estate-construction
property-management
state-machine
maintenance-automation