← portfolio.os/ projects / bco_lead_automation

project / bco_lead_automation

BCO Lead Automation

in-progress
CloudData Analytics

Overview

A lead-generation automation pipeline built for Builders Collective Ottawa (BCO), a community/sponsorship-driven org, to build a scored list of Ottawa-area tech companies worth approaching for sponsorship. It's not a web app. It's a self-hosted n8n instance orchestrating scraper actors that feed a shared Google Sheet.

Problem

Finding and qualifying sponsorship-worthy tech companies in Ottawa by hand (checking member directories, searching maps by category, cross-referencing who's already been contacted) doesn't scale past a handful of leads at a time. The goal was an automated first pass that builds a deduplicated, scored candidate list, leaving the human judgment (relevance, sponsorship capacity, personalized outreach) for after the raw list exists.

What I built

  • A self-hosted n8n instance (Docker Compose, forked from a local n8n template) running two workflows on manual triggers
  • Directory scraper workflow: pulls the Kanata North Business Association member directory, Invest Ottawa's company list, and the Ottawa Board of Trade tech directory via Apify actors, normalizes results, and appends them to a Raw - Directories sheet
  • Google Maps scraper workflow: runs 6 category searches (software, AI, cybersecurity, cloud, telecom, robotics) via an Apify Google Maps actor, capped at 20 results each (~120 max) with contact enrichment/reviews/images deliberately disabled to control Apify's per-result cost, appending to Raw - Google Maps
  • Both workflows dedupe and upsert into a shared Master Leads sheet using a Dedup Key, with manual scoring columns (BCO Relevance, Sponsorship Capacity, Ottawa Presence, Community Signal → Priority Score) for a human to fill in afterward
  • A GCP project holding the service account/OAuth credentials and IAM permissions that let n8n read and write the shared Google Sheet
  • BCO Leads 2.0: an enrichment pass built with Claude Code on top of the raw V1 scrape, adding per-company contact emails, personalization hooks, and outreach-status tracking, covering the KNBA and Invest Ottawa lead sets
  • The V1 n8n workflows themselves were built with Claude and Cursor as AI pair-programmers for the workflow/config authoring

Architecture

n8n (Docker Compose, port 5678, persistent n8n_data volume) is the orchestration layer. Each workflow calls out to Apify actors via HTTP request nodes, one hitting a general web-scraper actor against directory pages, the other hitting a Google Maps scraper actor, using APIFY_TOKEN. Results are normalized in n8n, filtered (directory results by tech keywords; maps results by category), and written to Google Sheets (BCO_GOOGLE_SHEET_ID) via upsert nodes keyed on a computed dedup key. Access to that sheet is governed by a GCP project (service account credentials and IAM permissions scoped to the Sheets API) rather than a personal Google account, so read/write access to Master Leads can be managed and revoked independently of any one person's login. Both workflows are manually triggered, not scheduled. This is a run-on-demand pipeline, not a fully autonomous one.

Currently two disconnected halves: the checked-in SETUP_README.md is explicit that this V1 pipeline does not find individual employees, enrich contact details, draft emails, or send outreach. A separate folder in the repo (Recovered KNBA and Invest Ottawa files/) does contain exactly that (contact emails, personalization hooks, outreach status per company), produced by BCO Leads 2.0, a Claude Code-driven enrichment pass run independently of the n8n workflows. The scraping automation (V1) and the enrichment work (2.0) aren't wired together into one pipeline yet.

Decisions

  • n8n + Apify over a custom scraper: let the pipeline reuse battle-tested scraper actors (web + Google Maps) instead of writing and maintaining scraping/anti-bot logic from scratch, at the cost of Apify's per-run pricing.
  • Manual triggers over a schedule: kept the pipeline run-on-demand while still validating the approach, rather than scheduling runs before knowing the data was actually useful.
  • Capping Google Maps results and disabling enrichment per search: a deliberate cost control: 20 results × 6 categories keeps the Apify bill predictable while still giving broad category coverage.

Results

A working, repeatable pipeline that produces a deduplicated Master Leads sheet from two independent sources (member directories + Google Maps), ready for manual scoring, plus a BCO Leads 2.0 enrichment pass that added contact emails, personalization hooks and outreach tracking for the KNBA and Invest Ottawa leads.

What I learned

  • Splitting "find candidates" from "qualify and personalize" into separate stages made it possible to ship the scraping half without having solved contact enrichment yet.
  • Deliberately disabling expensive Apify enrichment options up front (reviews, images, contact details) kept early iteration cheap while the workflow shape was still changing.
  • A stable dedup key is what makes multi-source scraping usable. The same company can appear in several directories and on Google Maps, and upserting on one computed key keeps Master Leads to one row per company.
  • Give automations their own credentials. A GCP service account for Sheets access means the pipeline doesn't depend on, or break with, anyone's personal Google login.
  • AI pair-programming (Claude, Cursor, Claude Code) sped up both the n8n workflow authoring and the enrichment pass, but leaving the two halves unconnected showed that stages built separately need a plan for how they join.

What's next

  • Connect BCO Leads 2.0's Claude Code enrichment pass back into the automated V1 pipeline so scraping and enrichment run as one flow
  • Consider moving from manual triggers to a schedule once the workflow shape is settled