Kay Abraham

Local time in Prague:

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

  1. How Expansion Engine runs, step by step:
  2. Billing alerts to Match
  3. Subscriptions to Match
  4. Ending rentals to Match
  5. Won deals to Match
  6. Support asks to Match
  7. CRM to Match
  8. Match to Score
  9. Score to Rank
  10. Rank to Slack digest
  11. Rank to Web page
  12. Rank to Report tab
  13. Match to Missing feed (a guard)
  14. Score to Refused terms (a guard)
Made-up item

04 Under the hood

  1. Runs as an Apify Actor in Standby mode, so the desk is a live web page.
  2. 786 tests, run every night in GitHub Actions.
  3. Desks for 7 Product Advocates, twice each weekday.
  4. Holds back any account already in a live deal or contacted in the last week, and gives one play per account.
  5. Tags every account with its owner, so one instance serves the whole team.
  6. State between runs lives in a named store, so a crash can't double-post or drop a window.
  7. Two guards: terms a customer refused are blocked from future offers, and a missing feed fails open and says so on the desk.
  8. The report tab started as a colleague's request and was built for the company all-hands.
desk.py Sketch
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.

Back to the machines