executing-plans
executing-plans
Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available
appfolio-core-workflow-bAutomate tenant management and lease operations with AppFolio. Trigger: "appfolio tenant management".
Independent GitHub snapshot · Automated classification · Original documentation governs
name: appfolio-core-workflow-b description: 'Automate tenant management and lease operations with AppFolio.
Trigger: "appfolio tenant management".
' allowed-tools: Read, Write, Edit, Bash(npm:), Bash(curl:), Grep version: 1.5.0 license: MIT author: Jeremy Longshore jeremy@intentsolutions.io tags:
Manage the full lifecycle of maintenance work orders through AppFolio's Stack API.
Use this workflow when tenants submit maintenance requests, when you need to assign
vendors to open work orders, track repair progress across properties, or close out
completed jobs with cost records. This is the secondary workflow — for property
dashboards and leasing, see appfolio-core-workflow-a.
const workOrder = await client.workOrders.create({
property_id: 'prop_4821',
unit_id: 'unit_12B',
category: 'plumbing',
priority: 'high',
description: 'Synthetic plumbing fixture leak reported in sandbox unit',
requested_by: 'tenant_8934',
due_date: '2026-04-10',
});
console.log(`Work order ${workOrder.id} created — status: ${workOrder.status}`);
const assignment = await client.workOrders.assign(workOrder.id, {
vendor_id: 'vendor_plumb_01',
scheduled_date: '2026-04-08',
time_window: '09:00-12:00',
notes: 'Confirm scheduled appointment through the approved work-order channel.',
});
console.log(`Assigned to ${assignment.vendor_name} on ${assignment.scheduled_date}`);
const open = await client.workOrders.list({
property_id: 'prop_4821',
status: ['open', 'in_progress', 'scheduled'],
sort: 'priority_desc',
});
open.items.forEach(wo =>
console.log(`#${wo.id} [${wo.priority}] ${wo.category} — ${wo.status} (due ${wo.due_date})`)
);
const closed = await client.workOrders.close(workOrder.id, {
resolution: 'Replaced P-trap and tightened supply line. No further leaks.',
labor_cost: 175.00,
materials_cost: 42.50,
completed_date: '2026-04-08',
attachments: ['receipt_plumb_0408.pdf'],
});
console.log(`Closed #${closed.id} — total cost: ${closed.total_cost}`);
| Issue | Cause | Fix |
|---|---|---|
401 Unauthorized | Expired or invalid API credentials | Refresh client_id/secret in Stack dashboard |
404 Work Order Not Found | Wrong work order ID or already deleted | Verify ID with workOrders.list() |
422 Missing required fields | Category or property_id omitted | Include all required fields per schema |
409 Conflict | Work order already closed | Check status before attempting close |
429 Rate Limited | Exceeded 120 requests/minute | Add exponential backoff with 1s base delay |
A successful run creates a work order, assigns it to a vendor with a scheduled service window, and closes it with cost records and resolution notes. The property manager gets a complete audit trail from request through completion.
For a sandbox plumbing workflow, create one synthetic work order with a stable idempotency key, assign a sandbox vendor, and read back its status before any transition. Attach only a non-sensitive test receipt, then close the order once and verify the total and audit record without logging tenant or access details. Replay the same request to prove duplicate work orders and duplicate cost records are rejected. If the vendor assignment, safety classification, prior state, or close outcome is uncertain, leave the order open and route it to the authorized property operator for review.
See appfolio-sdk-patterns for authentication setup and pagination helpers.