PM Operations Agent

InternalCopilot on Salesforce Agentforce serving as a digital operations co-pilot for property managers — vendor dispatch with rotation algorithm, lease renewal pipeline, compliance monitoring, and unit turnover coordination. The internal counterpart to the PM Tenant Service Agent.

Salesforce AgentforceApexAgentScriptInternalCopilotFlowSOQLProperty Management

Overview

The PM Operations Agent is an internal AI-powered assistant built on Salesforce Agentforce (InternalCopilot, AgentforceEmployeeAgent planner) that acts as a digital operations co-pilot for property managers. Deployed inside the Salesforce sidebar for authenticated employees, it handles four critical property management workflows: vendor dispatch, lease renewal pipeline management, compliance monitoring, and unit turnover coordination. Architecturally distinct from the companion PM Tenant Service Agent (ExternalCopilot) — no identity verification step is required since the PM is already authenticated in Salesforce. Built with 4 custom Apex actions (24 unit tests, 95% code coverage), 4 Flow wrappers, 2 custom Salesforce objects, and 13 custom fields purpose-built for the property management domain.

Problem

Property managers juggle dozens of concurrent responsibilities across their portfolio — tracking vendor assignments, chasing lease renewals, monitoring compliance deadlines, and coordinating unit turnovers — all from fragmented systems. Finding the right contractor for a maintenance issue requires searching a vendor database, checking trade specialization, and rotating fairly across equally-rated vendors. Lease renewal outreach gets missed because there's no systematic pipeline. Compliance items fall through the cracks without a monitoring layer. The result: reactive operations instead of proactive management, and hours burned on coordination that should be automated.

Approach

Four Agent Script topics with a priority-ordered hybrid routing architecture combining deterministic keyword-based intent classification with LLM conversational flexibility. First-match-wins routing prevents misroutes between overlapping topics. (1) Vendor Dispatch — the LLM maps natural language ('plumber', 'leak', 'pipe') to standardized picklist values (Plumbing, Electrical, HVAC, General, Painting, Locksmith). Selection algorithm: Rating__c DESC, then Last_Used_Date__c ASC NULLS FIRST for fair rotation among equally-rated vendors. Intelligent fallback: if no vendor is assigned to the specific building, broadens search to all active vendors with that trade type. Creates a dispatch Task and updates last-used date. Required 3 topic iterations to achieve reliable action execution — the critical discovery was the setVariables anti-pattern: the setVariables → guard → action sequence is unreliable for InternalCopilot because the LLM consistently skips the variable-setting step. Engineered the direct with param=... pass-through pattern as the reliable alternative. (2) Lease Renewal Pipeline — queries active leases expiring within a configurable window (60-day default). Duplicate-aware task creation: queries existing Tasks on the building Account and scans descriptions for 'Lease Renewal Follow-up' before creating — prevents duplicate outreach per lease. Tasks link to the building Account (not Lease) due to Salesforce's polymorphic WhatId field limitation; Description carries unit and lease context. (3) Compliance Monitoring — dynamic SOQL optionally filters by building name if specified, returns all buildings otherwise. Overdue detection flags any item past due date as CRITICAL. Supports 6 types: Fire Inspection, Elevator Certification, Boiler Inspection, Lead Paint Inspection, Section 8 Recertification, General Compliance. Configurable window (30-day default). (4) Unit Turnover Workflow — LLM parses natural language dates ('March 31') to yyyy-MM-dd. Creates 5 standardized Tasks with staggered offsets: Move-Out Inspection (day 0), Punch List Creation (+1), Vendor Scheduling (+3), Marketing Re-listing (+7), Make-Ready Completion (+10). Returns full checklist with an estimated 10-14 day timeline. Platform limitation workarounds discovered and solved: Task.WhatId doesn't support custom object IDs → linked to building Account with context in Description; LongTextArea fields can't be filtered in SOQL WHERE → query-then-filter-in-Apex; Vendor__c AutoNumber Name field is not writable → created separate Vendor_Name__c display field; MCP tool doesn't support Checkbox/Currency types → used Picklist (Yes/No) and Number alternatives. All actions follow the proven InternalCopilot pattern: String inputs/outputs, flow:// targets (never apex://), clear descriptions for LLM parameter discovery.

Tech Stack

Salesforce AgentforceAgent Script DSLApex (@InvocableMethod)Autolaunched FlowsSOQLInternalCopilotAgentforceEmployeeAgentCustom Objects (Vendor__c, Compliance_Item__c)

Results

24/24 Apex tests passing at 95% code coverage. 4/4 agent topics working in production. 3 iterations from first deploy to a fully working agent. 2 custom objects, 13 custom fields, 4 Apex classes, 4 test classes, 4 Flows, 1 Agent Script — all built, tested, and deployed in a single session. Zero manual intervention failures on all Salesforce UI steps. Operational impact: vendor dispatch drops from 15-20 minutes to under 30 seconds per incident (dozens per month). Lease renewal automation prevents vacancies that cost $2,000-5,000/month per unit. Compliance monitoring prevents fines ranging $500-50,000 per violation depending on jurisdiction. Unit turnover standardization reduces average vacancy period. Ships with a complete demo dataset: 6 vendors across 2 buildings (Plumbing, Electrical, HVAC, General), 5 compliance items including 2 intentionally overdue, 3 leases expiring within the 60-day window, and existing tenant/unit records for turnover demos — ready for live walkthroughs without setup. Designed as the internal counterpart to the PM Tenant Service Agent: together they demonstrate a complete AI-powered property management system from both sides — what tenants interact with externally, and what property managers get internally to run their operations.