Problem Statement
The goal is to design an automated lead‑scoring workflow in a MarTech environment using a CRM such as HubSpot or Salesforce. The workflow must reliably ingest new leads, evaluate them against scoring criteria, update fields, branch based on qualification rules, and log all actions for auditability. The specification must include triggers, conditions, data contracts, idempotency rules, and rollback processes.
Steps
Ingest New Lead Data
INGESTDetect a new or updated lead entering the CRM and capture key fields such as email, job title, lifecycle stage, and activity logs. Normalize and validate basic formatting and required properties before processing.
Retrieve Activity & Profile Attributes
EXECUTEPull engagement activity (email opens, form submissions, page views) and demographic attributes from CRM and any connected enrichment source. Ensure all required fields exist or provide defaults.
Generate Lead Score
EXECUTEApply scoring rules to demographic and behavioral data to produce a consistent lead score. Rules may include point additions, subtractions, and thresholds for qualification.
Validate Qualification Logic
EXECUTEEvaluate whether the lead meets thresholds such as MQL (Marketing Qualified Lead) or SQL (Sales Qualified Lead). Prevent duplicate processing by checking idempotency markers.
Write Back to CRM & Log Actions
INGESTUpdate the CRM with the calculated lead score, qualification status, and workflow audit logs. Ensure error-handling branches capture failed writes and retry with backoff.
Prompt Configurations
Lead Scoring Rule Generator
You are an assistant generating a structured lead score from provided demographic and behavioral attributes. Produce a single numeric score using only the fields supplied. Do not invent missing data. Apply consistent weighting: demographic relevance (40%), engagement behavior (60%). Maintain a professional tone and output only the JSON object containing {score, reasoning}.Example Inputs/Outputs
Lead: [email protected], job_title=Director of IT, page_views=8, ebook_downloads=1, email_opens=4.
Score generated: 78. Reasoning: senior job title (+35), high engagement (+43). Lead marked MQL; CRM fields updated with score=78 and qualification_status='MQL'.