Portfolio balance

Shipped

Caps each recipient or group's share of recent assignments.

Example

How Portfolio balance decides — the pool is evaluated and the winner is assigned. Each strategy selects differently.

type == "lead"selectedTriggerNew LeadWebhookScorePortfolio balanceStrategyae-westscore 96ae-eastscore 81centralscore 73Assigned
Show the code
// Portfolio balance selects from the pool and assigns.
engine.Route(ductor.Route{
Match: `routable.type == "lead"`,
Strategy: "portfolio_balance",
Pool: "sales-team",
})
 
// Durable, observable, exactly-once.
decision, err := engine.Dispatch(ctx, routable)

Parameters7

window_sizenumberdefault 100
max_sharesliderdefault 0.501
rebalance_strengthsliderdefault 1010
min_assignmentsnumberdefault 0
group_by_metadatastring
base_strategystringdefault smooth_weighted_round_robin
empty_window_modeenumdefault base_strategy
base_strategy · fair_weighted · error

Cached parameter metadata — connect the engine for live defaults.

How it works

Keeps recent assignment share under configured per-recipient or per-metadata-group caps to avoid concentration risk, rebalancing toward under-served recipients with explicit empty-window behavior.

WeightedExplainable