CULTIVA Leads Pipeline — cultiva-leads-pipeline/src/ · Python 3.12 · FastAPI + sklearn + HubSpot
score_leadflowchart TB
parse_webhook --> score_lead
import_csv --> score_lead
ingest_route --> score_lead
score_lead --> preprocess
score_lead --> build_feature_vector
score_lead --> load_model
preprocess --> normalize
build_feature_vector --> log_event
style score_lead fill:#1f3b54,stroke:#79c0ff,color:#79c0ff
flowchart LR
main --> ingestion.webhook
main --> ingestion.csv_import
main --> ingestion.linkedin
ingestion.webhook --> enrichment.clearbit
ingestion.csv_import --> enrichment.fullcontact
ingestion.linkedin --> scoring.model
scoring.model --> scoring.features
enrichment.clearbit --> crm.hubspot
enrichment.fullcontact --> crm.mapper
scoring.model -.-> utils.db
enrichment.clearbit -.-> utils.logger
flowchart TB
enrich_contact:::high -->|CC=18| score_lead:::high
score_lead:::high -->|CC=16| parse_webhook:::med
parse_webhook:::med -->|CC=13| build_feature_vector:::med
build_feature_vector:::med -->|CC=11| push_to_hubspot:::med
push_to_hubspot:::med -->|CC=9| import_csv:::med
classDef high fill:#3d1f1f,stroke:#f85149,color:#f85149
classDef med fill:#3b2d00,stroke:#e3b341,color:#e3b341
classDef low fill:#1a3a2a,stroke:#3fb950,color:#3fb950
push_to_hubspotflowchart TB
src_http[HTTP POST /ingest]:::entry --> validate_payload
src_csv[CSV upload]:::entry --> validate_payload
src_li[LinkedIn hook]:::entry --> enrich_contact
validate_payload --> enrich_contact
enrich_contact --> score_lead
score_lead --> map_lead_fields
map_lead_fields --> push_to_hubspot:::sink
push_to_hubspot:::sink -.->|TAINT: email,phone,company| taint_note
classDef entry fill:#2d1f54,stroke:#d2a8ff,color:#d2a8ff
classDef sink fill:#1a3a2a,stroke:#3fb950,color:#3fb950