002 Machines 01 / 07
Expansion Engine
Reads six live signal feeds, scores every account and hands each Product Advocate a ranked desk twice a day.
- Status
- Running
- Since
- Running since July 2026
- Built with
- Python · Apify · Slack · HubSpot · Snowflake
- Proof
- 780+ tests · nightly CI
01 The miss
Accounts grew quietly and never tripped an alarm. A customer was pushed on terms they had already refused, and left. A CRM source went missing for two months and no alert fired.
Corrected Expansion Engine K.A.
02 The machine
An Apify Actor in Python. Six feeds come in: billing alerts, subscriptions, ending rentals, won deals, support asks and the CRM. Every account gets a score. Every Product Advocate gets a ranked desk, twice a day, as a Slack digest, a web page and a report tab.
03 How it runs
- How Expansion Engine runs, step by step:
- Billing alerts to Match
- Subscriptions to Match
- Ending rentals to Match
- Won deals to Match
- Support asks to Match
- CRM to Match
- Match to Score
- Score to Rank
- Rank to Slack digest
- Rank to Web page
- Rank to Report tab
- Match to Missing feed (a guard)
- Score to Refused terms (a guard)
04 Under the hood
- Runs as an Apify Actor in Standby mode, so the desk is a live web page.
- 786 tests, run every night in GitHub Actions.
- Desks for 7 Product Advocates, twice each weekday.
- Holds back any account already in a live deal or contacted in the last week, and gives one play per account.
- Tags every account with its owner, so one instance serves the whole team.
- State between runs lives in a named store, so a crash can't double-post or drop a window.
- Two guards: terms a customer refused are blocked from future offers, and a missing feed fails open and says so on the desk.
- The report tab started as a colleague's request and was built for the company all-hands.
FEEDS = ("billing_alerts", "subscriptions", "ending_rentals", "won_deals", "support_asks", "crm") def build_desks(accounts, advocates): health = {} for feed in FEEDS: signals = read(feed) if signals is None: # fail open, never silent health[feed] = "missing" # the desk says so out loud continue attach(accounts, signals) # each signal to its account for account in accounts: account.score = score(account) account.offers = [o for o in offers(account) if o not in account.refused] # never twice desks = {pa: ranked(owned_by(pa, accounts)) for pa in advocates} return desks, health Written for this page to show the logic. The production code stays in a company repo.
05 What changed
- Quietly growing accounts now show up on the desk.
- Refused terms are blocked from future offers.
- Every missing source announces itself on the desk.
06 What I can show
The repo is private and the data is company data, so this page describes the machine. The desk on the front page runs on made-up accounts for that reason.