Lead Pipeline — Get Scoring Script (large pipelines)
lead_pipeline_get_engineFor pipelines LARGER than 500 lead rows. Returns a complete, runnable Python script that loads the lead export in your sandbox and scores it locally (conversion probabilities, money layer, Shapley attribution, CALL / NURTURE / VERIFY queue). Makes no network calls — same shape as Customer Tiering — so Copilot Studio works even when outbound POST is blocked. The rows never pass through you as tokens. Needs numpy. Prints ranked decisions and headline figures; writes the full per-lead ledger to lead_pipeline_result.json. SAVE AND RUN THE RETURNED SCRIPT VERBATIM — do not retype, shorten, reformat, or reimplement it; only PATH / TOUCHES / STAGE_HISTORY / AS_OF / CURRENCY / OUT may be edited. Optionally takes touches_path and stage_history_path for engagement and funnel history.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| as_of | No | Analysis date YYYY-MM-DD. Defaults to latest in file. | |
| currency | No | ISO currency code for display (INR, USD, EUR...). | USD |
| file_path | Yes | Path to the lead export (CSV/TSV/JSON) inside your sandbox. Needs lead_id + created_date per row; optional stage, status, closed_date, deal_size, source. | |
| touches_path | No | Optional path to a touch / activity log (lead_id, date, optional channel). | |
| stage_history_path | No | Optional path to stage-change history (lead_id, date, stage). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| notes | No | ||
| script | Yes | The runnable scoring script. | |
| currency | No | ||
| language | No | ||
| requires | No | ||
| writes_file | No | ||
| instructions | Yes | ||
| code_integrity | Yes | ||
| engine_version | Yes | ||
| file_path_used | No | ||
| scipy_required | No | ||
| data_requirements | No | ||
| touches_path_used | No | ||
| network_access_required | No | ||
| stage_history_path_used | No |