# Renewal Offer Orchestration
Run the 120-day lease-renewal pipeline end to end, from pulling upcoming expirations to sending manager-approved renewal offers and scheduling follow-ups.

## When to use
- A tenant's lease is approaching its expiration window (120 days out) and a renewal offer needs to be prepared and sent.
- You need to track renewal-offer status across a portfolio and nudge tenants who haven't responded.
- A manager has approved final pricing and you need to notify the tenant and log the next check-in.
- You must escalate a lease that requires formal legal notice (late payment, eviction) instead of a routine renewal.

## Tools
- `http-get`
- `send-email`
- `schedule-task`
- `create-task`

## Playbook
1. Call `http-get` against the property-management system's REST API to pull leases entering the 120-day renewal window, e.g. `GET https://api.example-pms.com/v1/leases?expiring_within_days=120`. Auth is injected by the org's Integration row for this host — never ask for, echo, or hardcode credentials.
2. For each lease, confirm that manager-approved renewal pricing exists by calling `http-get` on `GET https://api.example-pms.com/v1/leases/{lease_id}/renewal-offer`. If no approved pricing is present, use `create-task` to open a task assigned to the property manager requesting pricing approval, and stop processing that lease until it clears.
3. Once approved pricing is confirmed, use `send-email` to send the tenant their renewal offer, including the new rent amount, lease term options, and the response deadline.
4. Use `schedule-task` to queue a follow-up check at day 100 (20 days after the offer, well inside the 120-day window) to re-pull the lease status via `http-get` and see whether the tenant has accepted, declined, or not yet responded.
5. If the tenant has not responded by the scheduled follow-up, use `send-email` to send a polite reminder and use `schedule-task` to queue a second follow-up 10 days later.
6. If the tenant declines or requests changes outside standard terms (e.g., a rent concession beyond the approved range), use `create-task` to route the exception to the property manager for a decision — do not counter-offer autonomously.
7. If, at any point, a lease record shows an overdue balance requiring a late notice or an eviction filing, do not draft or send this via `send-email` directly to the tenant as a final notice. Instead, use `create-task` to hand the drafted notice text to the manager for review and approval before any formal legal notice is sent.
8. If the lease file shows an active emergency maintenance flag (e.g., no heat, water leak, gas smell), stop the renewal workflow immediately and use `create-task` to escalate to a human on-call contact — this takes priority over any renewal step.
9. Once the tenant accepts, use `http-get` to confirm the updated lease status reflects the signed renewal, then use `create-task` to close out the renewal record with a summary of the final terms for the manager's file.

## Failure modes
- Sending a renewal offer before pricing approval exists — always verify the approved pricing record via `http-get` before calling `send-email`.
- Treating a late-payment or eviction notice as routine correspondence — these must always be drafted for manager approval via `create-task`, never sent autonomously.
- Letting a follow-up silently expire without a new `schedule-task` — each unanswered offer needs a next scheduled check, not a one-and-done reminder.
- Continuing the renewal pipeline while an emergency maintenance issue is flagged on the same unit — escalate to a human first.

## Done when
- The tenant has received a manager-approved renewal offer and either accepted, declined, or is on a scheduled follow-up cadence.
- Any exception (pricing dispute, legal notice, emergency maintenance) has been routed to a human via `create-task` rather than resolved automatically.
- The lease record reflects the final outcome and a summary task has been closed out for the manager's records.