Machines01 / 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
The miss
The signals sat in six places and nobody saw them together. A growing account looked quiet. A follow-up went to someone who had already said no. A data feed went dark for two months, and nothing noticed.
Corrected Expansion Engine K.A.
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.
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)
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.
- Each card carries its owner, why the account ranked, the play, a folded deal record and the sources behind it.
- When an account is stuck at its usage limit, the card opens on that limit, and only after the warehouse confirms it that day.
- The desk works on a phone, with one-row controls and tap targets sized for a thumb.
- Account dossiers are in pilot: one file per account with every fact sourced and dated, read by each agent before it digs.
- A quote preview is in progress, pricing an account's last full month at the calculator's options next to its current bill.
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, healthWritten for this page to show the logic. The production code stays in a company repo.
What changed
- Quietly growing accounts now show up on the desk.
- Every card now shows why it ranked and the sources behind it.
- Refused terms are blocked from future offers.
- If a source goes missing, the desk says so.
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.