AI Demand Planning Engine
Reorder quantities were being estimated from spreadsheets that were stale before they were finished. Marsos built a pipeline that combines sales, distributor and inventory data into one demand signal, applies the client's own ordering rules to it, and writes suggested quantities back into Salesforce — so a rep opens the storefront and the order is already filled in.
Delivery signals
Demand planning & suggestive-order pipeline
Pre-filled orders
suggested quantities waiting in the storefront, not in a spreadsheet
One signal
own sales, distributor sales and stock on hand combined
Client's own rules
case packs and minimum order quantities applied per product
Closed loop
recommendations land back in the tools reps already use
01 / Context
The operating environment
The demand-planning programme needed a closed loop between primary sales in Salesforce, distributor secondary-sales files, inventory, demand drivers, forecasting, business rules, BI dashboards, and suggested orders in the B2B storefront.
02 / Business outcome
What changed for the client
The result this engagement delivered — before any of the engineering behind it.
Unified primary sales, secondary sales, inventory, and demand drivers into one forecasting signal.
Automated business-rule-validated suggested reorder quantities per product and account.
Closed the loop by writing recommendations back to Salesforce and presenting pre-filled suggested orders in the B2B storefront.
Produced Tableau consumption layers for distributor performance, coverage, and executive KPI monitoring.
03 / Challenge
Complexity before transformation
Primary sales, distributor secondary sales, inventory, and demand-driver data arrived from different systems and formats.
The forecasting layer needed cleaning, joins, date buckets, aggregation, seasonality, growth factors, and business-rule validation.
Suggested quantities had to respect minimum order quantities, case packs, classifications, stock coverage, lead time, and Make-to-Order or Make-to-Stock behaviour.
Results needed to return to Salesforce for account-and-product-specific storefront recommendations while also feeding Tableau analysis.
04 / Delivery
What Marsos engineered
Built a Tableau Prep flow that unifies Salesforce and spreadsheet inputs, resolves duplication, and prepares forecast-ready data.
Implemented forecast calculations and a business-rules engine for minimum order quantity, case-pack optimization, classification, inventory coverage, and lead time.
Generated machine-readable CSV outputs for Python injection and Hyper extracts for Tableau dashboards.
Built a Google Cloud and Python integration bridge using schema validation, type transformation, retry logic, logging, and Bulk API 2.0 upsert into Salesforce.
05 / How it works
End-to-end data flow
The system, one step at a time — the sequence that carries an order, a shipment or a decision from start to done.
- 01
Data sources
Primary sales, distributor secondary sales, on-hand inventory and demand drivers — seasonality and promotions — enter one load pipeline.
- 02
Analytics and transformation
Tableau Prep joins, cleans and aggregates, then the forecast algorithm and business-rules engine compute suggested quantities.
- 03
Output layer
Machine-readable CSV extracts for injection and Hyper star-schema extracts for BI.
- 04
Integration bridge
Google Cloud middleware and a Python loader validate schemas, transform types and UPSERT into Salesforce with retry logic and external-ID matching.
- 05
Consumption
Distributors see pre-filled suggested orders in the B2B storefront; executives track coverage and KPIs in Tableau dashboards.
06 / System Architecture
Architecture revealed as a system story.
Scroll through the technical decisions to see how each platform layer connects to the next.
Open full-size diagram ↗The full path from raw sales data to a pre-filled order in the distributor storefront: sources blended into one demand signal, the forecast and the client's own ordering rules applied, then results written back to Salesforce and Tableau. Client, brand, warehouse and region identifiers removed; sample data genericised.
Active decision
Used a closed-loop Salesforce to Tableau to Python to Salesforce flow rather than a disconnected forecasting report.
Architecture decision
Used a closed-loop Salesforce to Tableau to Python to Salesforce flow rather than a disconnected forecasting report.
Architecture decision
Matched suggestion records by external account-and-product identifiers for repeatable upsert and conflict handling.
Architecture decision
Kept forecast inputs, business-rule outputs, CRM records, storefront consumption, and BI dashboards aligned.
Architecture decision
Removed client, warehouse, distributor, region, and endpoint identifiers from the public reference architecture.
07 / Engineering highlights
Where the hard problems were won
The proof points a technical buyer should inspect first.
Impact
Unified demand signal
Salesforce primary sales blend with distributor secondary sales into one forecasting dataset via Tableau Prep — outlier-adjusted and projected forward with growth factors.
Impact
Automated suggestive ordering
A forecast algorithm plus a business-rules engine — MOQ rounding, case-pack optimization, classification — derives preset reorder quantities per SKU.
Impact
Closed-loop CRM and BI
Python with Bulk API 2.0 UPSERT writes results back into Salesforce; Hyper extracts feed Tableau dashboards — one pipeline serving both.
Impact
Distributor self-service
The B2B storefront surfaces a Suggested Order page pre-filled with recommended quantities, keyed per account and product.
08 / Platform surface
The capability map
Planning parameters
09 / Technology
The delivery stack
Salesforce B2B Commerce
Tableau Prep
Tableau Cloud
Google Cloud
Python
Pandas
Salesforce Bulk API 2.0
OAuth 2.0
Confidentiality protocol
Use generic data only. Do not expose client, brand, distributor, warehouse, region, table, file, or endpoint identifiers from production systems.
Build with Marsos
Bring us the difficult system.We will make it buildable.
Start with a clear technical direction, an architecture that can scale, and a delivery plan your team can trust.