Contact

hello@moreproof.io

howdydootoyou
Case Study

CSM Assignment Engine

A dynamic workload optimization engine that routes accounts based on a Constrained Greedy Heuristic, balancing representative capacity, account complexity, and strategic risk.

System: constrained greedy assignment
PULL → SCORE → STAGE → BALANCE1. Pull2. Score3. Stage4. Balance4-D CAPACITY MATRIXComplexityVolumeFitTenurehuman-in-the-loop gateBALANCED BOOKS

The Problem

Hidden complexity creates false balance

Naive assignment models treat a $50K single-product account and a $500K five-product account identically — overloading reps with lower headcount but higher complexity.

Assigning SaaS accounts based purely on "current account count" creates a hidden imbalance. A $50K single-product account and a $500K five-product account require vastly different operational lift, yet naive assignment models treat them identically. As a result, reps with a lower absolute headcount are frequently the most overloaded due to hidden account complexity. Building a pure mathematical solver (like Linear Programming) to fix this is too resource-heavy and will consistently time out within Google Apps Script's execution limits.

The Solution

Constrained Greedy Heuristic

This system trades academic perfection for operational reality. It separates the pure mathematical scoring from the human-in-the-loop workflow, ensuring automation enhances — rather than overrides — management strategy. The engine uses a custom greedy assignment loop where accounts are pre-sorted by complexity (descending), and capacity is re-calculated dynamically after every single assignment.

Scoring Matrix

Four-dimensional capacity evaluation

35

Volume (35%)

Proximity to total account headcount ceilings. Prevents overloading reps who are already at capacity.

25

ARR (25%)

Proximity to financial portfolio caps. Anchored strictly to Annual Recurring Revenue, ignoring TCV to avoid inflating multi-year deal workload.

25

Renewal Balance (25%)

Smoothing out quarterly renewal distributions so reps aren't buried in a single quarter. Prevents seasonal overload spikes.

15

Portfolio Risk (15%)

The current proportion of at-risk accounts, ensuring reps with struggling books aren't handed more turbulence.

Design Patterns

Human-in-the-loop guardrails

🛡️

The Bouncer Pattern

Automation handles the bulk, but human intuition handles the exceptions. If the system detects a high-value "Enterprise Alert" account (top-tier segments under ~300 total accounts), the assignment loop halts. The engine intentionally blocks direct automation for these targets, alerting leadership that a white-glove, manual match is required based on executive alignment and historical relationships.

📊

ARR vs. TCV Anchoring

Capacity limits are anchored strictly to ARR, ignoring TCV. A 3-year deal at $100k ARR evaluated as $300k TCV instantly eats up rep capacity. When renewed for a standard 1-year term, the math incorrectly registers a massive retention penalty. Anchoring to ARR keeps workload grounded in present-day reality.

🧲

The New Hire Magnet

Ramping reps need repetitions, not complex math. The engine applies a flat volume boost (Score = 85) to new hires. Protected by the Bouncer preventing them from taking Enterprise accounts, this logic turns new reps into magnets for standard accounts until they hit their targeted ramp capacity.

How It Works

Pull → Score → Stage → Balance

1

Pull live data

Google Apps Script pulls live ARR, product subscriptions, renewal dates, and health metrics from Totango and Salesforce APIs into the working dataset.

2

Score CSM portfolios

The ScoringEngine evaluates current CSM portfolios against the four-dimension matrix. A single-product $50K account and a five-product $500K account are no longer treated as equal weight.

3

Stage assignments

The AssignmentWorkflow ranks eligible CSMs, stages the highest-scoring candidate, and allows for manual manager override before committing. The Bouncer halts automation for Enterprise accounts.

4

Dynamic balance

Upon commit, capacity is re-calculated dynamically. The next account is assigned to the CSM with the most remaining capacity. Results are logged for audit and rebalancing.

Visual Architecture

Complexity scoring and greedy assignment

Totango + SFDCPull live dataARR, Products, RenewalsScoringEngineVolume 35% + ARR 25%+ Renewal 25% + Risk 15%→ CSM capacity scoreBouncerEnterprise?→ Manual overrideStandard → ContinueAssignmentGreedy heuristic sortsaccounts by complexityDesc → assigns to bestBalanceDynamiccapacity🧲 New Hire MagnetScore = 85 (flat) for reps < 2 months → absorbs standard accounts📊 ARR Anchored (Not TCV)100k ARR × 3-yr deal ≠ 300k capacity — avoids renewal penalty math

Results

Operational impact

1,200+

Accounts assigned dynamically

4D

Scoring matrix (Volume, ARR, Renewal, Risk)

0

Manual spreadsheet passes required post-deployment

Connected Systems

Google Apps ScriptTotango APISalesforce APIGlean API

Design Patterns

Constrained Greedy HeuristicBouncer PatternARR AnchoringNew Hire MagnetStaging → CommitCheckpoint/Resume

Source Code

The full implementation is available as a sanitized reference repository. It includes the Google Apps Script engine, Python data prep scripts, configuration schemas, and architecture documentation.

View on GitHub

Methodology Phases

DiscoverManual process mapping & pain analysisDesignFour-dimension scoring matrix & greedy heuristicDeliverGoogle Apps Script engine with API integrationsGovernBouncer pattern & human-in-the-loop guardrails