Skip to content
NEWMarketplace and the trig8n Agent: sell what you build, and get plans and changes that are tested before you see them. See what is new

Library / Email Automation

Email Automation

Score new building permits from Apify for contractor outreach with OpenAI, Slack and

On a schedule, it handles email with OpenAI / ChatGPT using Gmail, Google Sheets, Slack, Apify.

What it does

## Score new building permits from Apify for contractor and supplier outreach Pulls recently issued building permits from city open-data portals through Apify, keeps only new ones, and scores them by project value, trade keywords, named contractor and freshness. Built for roofers, solar installers, HVAC and electrical trades, suppliers, architects and equipment rental firms that want to reach projects while materials and subcontractors are still being chosen. ### How it works 1. A daily schedule (or the manual trigger) loads Config; a Monday schedule sends a 7-day report instead. 2. Runs the Apify actor building-permits-leads and downloads the results. 3. Drops incomplete rows and anything already seen in the last 30 days. 4. Score permit leads gives a 0-100 rule score; an OpenAI model adds a fit score, verdict and summary. 5. Upserts every row to the Permits sheet tab. Hot rows go to Slack for approval, warm rows to an email digest. ### Setup steps - [ ] Add an Apify HTTP Header Auth credential (Authorization: Bearer ) on the 3 Apify HTTP nodes. - [ ] Create a Google Sheet with the columns in *Upsert to Google Sheets* and paste its ID into googleSheetId. - [ ] Connect OpenAI, Slack and Gmail; set slackChannelId and digestEmail in Config. - [ ] In Config set actorInput.cities (city codes the actor lists), sinceDays, minValuation, then permitKeywords (permit types you serve) and descriptionKeywords (words in the work description). - [ ] Describe your ideal result in aiCriteria, run once manually, then activate. ### Customization - Change the weights in Score permit leads (valuation up to 35, permit type 20, description 20, contractor 10, freshness 15). - Needs an Apify account; actor runs use your Apify credits.

The steps

  1. Daily schedule
  2. Run manually
  3. Weekly report schedule
  4. Config
  5. Daily run or weekly report?
  6. Start Apify run
  7. Wait before polling
  8. Get run status
  9. Check run status
  10. Route by run status
  11. Stop: Apify run failed
  12. Fetch dataset items
  13. Validate and dedupe
  14. Any new records?

35 steps in total.

Similar automations