How we automated pest control proposals with OpenClaw, step by step

Here’s the full build, since the short version left out the parts people actually need. This is the proposal pipeline we built for my family’s pest control company. The agent does the legwork, plain code does the math, and a person signs off.

From a sample proposal. The company and prices are made up; the template and the pipeline are the real ones. Full sample proposal

1. Lead in. A website form or a Facebook lead ad starts it through an automation, or a salesperson texts the address and the service to their agent in Telegram.

2. County lookup. The agent pulls the county property appraiser record by address or parcel ID. It’s a small scraper (cheerio) with a cache and rate limiting, so you don’t hammer the county site. It returns square footage, beds and baths, year built, foundation, siding, roof type, lot size, pool, garage and other structures.

When the record has no perimeter, we estimate it from the footprint:

// ratio = length / width of a typical footprint
// complexity > 1 for L-shapes and bump-outs
const width = Math.sqrt(sqft / ratio);
const length = ratio * width;
const perimeterFt = Math.round(2 * (length + width) * complexity);

3. Pricing lives in code, not in the prompt. A small pricing engine does the math, so the same house gets the same price every time and you can unit-test it. All the rates sit in one config file. Here’s the shape of it (the numbers are examples, plug in your own):

termite:   { per_linear_ft: 8.00 }  # liquid, full perimeter
woodtreat: { per_roof_sqft: 0.75 }  # roof decking area
general:   { flat: 99 }
rodent:
  per_station: 60
  # stations = ceil(perimeter / ft_per_station)
  # base fee = follow-ups + traps + exclusion + labor + margin
  tiers:
    light:    { ft_per_station: 65, base_fee: 350 }
    moderate: { ft_per_station: 40, base_fee: 650 }
    heavy:    { ft_per_station: 23, base_fee: 1000 }

With those numbers, the 183 ft house in the sample comes out at $530 / $950 / $1,480.

Wood treatment is priced on roof decking, not floor area. Decking = floor sqft × pitch factor:

// 5/12 pitch -> 1.083
const pitchFactor = (rise: number, run = 12) =>
  Math.sqrt(1 + (rise / run) ** 2);

If we don’t know the pitch, we assume 5/12.

4. Template. One locked HTML template per service: print-ready, 8.5 inches wide, brand fixed. The agent fills in the findings, entry points, species and notes, marks the recommended tier, numbers the proposal and saves the PDF. It never touches the layout.

5. Human gate. The PDF goes to the salesperson in Telegram. Nothing reaches the customer until they reply OK or ask for changes.

What I’d copy:

  1. Do the first 20 or so with the agent in plain chat. You’ll see which steps repeat.
  2. As soon as math repeats, move it into a script. Let the model gather inputs and write. Don’t let it price.
  3. Keep the human gate per job type until that type earns trust. Simple jobs earned it first, so realtors now get instant quotes. Bigger proposals still go through review.

Gotchas: the county site doesn’t hand you the building sketch, so the agent falls back to a simple drawing. Early PDFs cut off the logo. Small stuff, but customers notice.

Happy to go deeper on any piece.

3 Likes

This is awesome, PJ!

Super helpful for anyone starting out as a small business that wants a straightforward way of getting situated with proposal generation.

Love to see this in the show & tell area!

Very nice. Thanks for this!